summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2018-11-21 11:45:04 +0800
committerAndrej Shadura <andrewsh@debian.org>2019-07-18 15:15:27 -0300
commit0d4a742af1e4cb51287044a30f6f79ab6e57b88f (patch)
treec5ac270ca99d6816907ea76785ac7b9b98a2f30d
parent28a033d7df43e20a72c88c9ff53e7a9641361475 (diff)
[PATCH] system: Disable glibc warning on sigsetmask
As sigsetmask is set as deprecated in glibc this patch adds the pragmas to disable the warning in gcc around our one and only use of sigsetmask. It also disables it completely for non-gcc compilers and older gcc compilers as they may generate a warning too. Reported-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Gbp-Pq: Name 0015-system-Disable-glibc-warning-on-sigsetmask.patch
-rw-r--r--src/system.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/system.h b/src/system.h
index a8d09b3..007952c 100644
--- a/src/system.h
+++ b/src/system.h
@@ -36,8 +36,17 @@
static inline void sigclearmask(void)
{
-#ifdef HAVE_SIGSETMASK
+#if defined(HAVE_SIGSETMASK) && \
+ (!defined(__GLIBC__) || \
+ (defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4006))
+#ifdef __GLIBC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
sigsetmask(0);
+#ifdef __GLIBC__
+#pragma GCC diagnostic pop
+#endif
#else
sigset_t set;
sigemptyset(&set);