[PATCH 4/5] Stop using deprecated function sigsetmask()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sigsetmask() is deprecated, at least on recent glibc; stop using it to
silence the following compiler warning:

-----------------------------------------------------------------------
system.h:40:2: warning: ‘sigsetmask’ is deprecated [-Wdeprecated-declarations]
  sigsetmask(0);
  ^~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/param.h:28,
                 from shell.h:52,
                 from nodes.c:46:
/usr/include/signal.h:173:12: note: declared here
 extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
            ^~~~~~~~~~
-----------------------------------------------------------------------

Using sigprocmask() and friends unconditionally should not be a problem,
as commit e94a964 (eval: Add vfork support, 2018-05-19) also does it.

Signed-off-by: Antonio Ospite <ao2@xxxxxx>
---
 configure.ac | 2 +-
 src/system.h | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 036730d..32ef456 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ AC_CHECK_DECL([PRIdMAX],,
 dnl Checks for library functions.
 AC_CHECK_FUNCS(bsearch faccessat getpwnam getrlimit isalpha killpg \
 	       mempcpy \
-	       sigsetmask stpcpy strchrnul strsignal strtod strtoimax \
+	       stpcpy strchrnul strsignal strtod strtoimax \
 	       strtoumax sysconf)
 
 dnl Check whether it's worth working around FreeBSD PR kern/125009.
diff --git a/src/system.h b/src/system.h
index a8d09b3..6950e6e 100644
--- a/src/system.h
+++ b/src/system.h
@@ -36,13 +36,9 @@
 
 static inline void sigclearmask(void)
 {
-#ifdef HAVE_SIGSETMASK
-	sigsetmask(0);
-#else
 	sigset_t set;
 	sigemptyset(&set);
 	sigprocmask(SIG_SETMASK, &set, 0);
-#endif
 }
 
 #ifndef HAVE_MEMPCPY
-- 
2.19.1




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux