aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorYury Norov <ynorov@caviumnetworks.com>2017-10-31 15:31:40 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-10-31 17:49:18 -0200
commit87bbc4cf1e95400e17670a38684c041319c3187b (patch)
tree9b9d1456a6d5077fc46d1e879f435d231e7eb81d /sysdeps/unix/sysv
parente8681faa01e782800aa44acd0f13b191aca13c81 (diff)
downloadglibc-87bbc4cf1e95400e17670a38684c041319c3187b.zip
glibc-87bbc4cf1e95400e17670a38684c041319c3187b.tar.gz
glibc-87bbc4cf1e95400e17670a38684c041319c3187b.tar.bz2
Remove useless #ifdefs from Linux sig*.c syscalls
sigprocmask.c, sigtimedwait.c, sigwait.c and sigwaitinfo.c files from sysdeps/unix/sysv/linux include nptl-signals.h via nptl/pthreadP.h, and so SIGCANCEL and SIGSETXID become defined unconditionally. But later in the code, there are some checks weither symbols defined, which is useless. This patch removes useless checks. Checked on x86_64-linux-gnu. * sysdeps/unix/sysv/linux/sigprocmask.c: Remove useless #ifdefs. * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. * sysdeps/unix/sysv/linux/sigwait.c: Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> Reviewed-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c9
-rw-r--r--sysdeps/unix/sysv/linux/sigtimedwait.c9
-rw-r--r--sysdeps/unix/sysv/linux/sigwait.c9
-rw-r--r--sysdeps/unix/sysv/linux/sigwaitinfo.c9
4 files changed, 4 insertions, 32 deletions
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index d0b8e04..e776563 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -30,26 +30,19 @@
int
__sigprocmask (int how, const sigset_t *set, sigset_t *oset)
{
-#ifdef SIGCANCEL
sigset_t local_newmask;
/* The only thing we have to make sure here is that SIGCANCEL and
SIGSETXID are not blocked. */
if (set != NULL
&& (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)))
{
local_newmask = *set;
__sigdelset (&local_newmask, SIGCANCEL);
-# ifdef SIGSETXID
__sigdelset (&local_newmask, SIGSETXID);
-# endif
set = &local_newmask;
}
-#endif
return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
diff --git a/sysdeps/unix/sysv/linux/sigtimedwait.c b/sysdeps/unix/sysv/linux/sigtimedwait.c
index ab1a84e..42afbce 100644
--- a/sysdeps/unix/sysv/linux/sigtimedwait.c
+++ b/sysdeps/unix/sysv/linux/sigtimedwait.c
@@ -29,25 +29,18 @@ int
__sigtimedwait (const sigset_t *set, siginfo_t *info,
const struct timespec *timeout)
{
-#ifdef SIGCANCEL
sigset_t tmpset;
if (set != NULL
&& (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)))
{
/* Create a temporary mask without the bit for SIGCANCEL set. */
// We are not copying more than we have to.
memcpy (&tmpset, set, _NSIG / 8);
__sigdelset (&tmpset, SIGCANCEL);
-# ifdef SIGSETXID
__sigdelset (&tmpset, SIGSETXID);
-# endif
set = &tmpset;
}
-#endif
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
diff --git a/sysdeps/unix/sysv/linux/sigwait.c b/sysdeps/unix/sysv/linux/sigwait.c
index 48bcd2f..395bd9f 100644
--- a/sysdeps/unix/sysv/linux/sigwait.c
+++ b/sysdeps/unix/sysv/linux/sigwait.c
@@ -33,25 +33,18 @@ do_sigwait (const sigset_t *set, int *sig)
{
int ret;
-#ifdef SIGCANCEL
sigset_t tmpset;
if (set != NULL
&& (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)))
{
/* Create a temporary mask without the bit for SIGCANCEL set. */
// We are not copying more than we have to.
memcpy (&tmpset, set, _NSIG / 8);
__sigdelset (&tmpset, SIGCANCEL);
-# ifdef SIGSETXID
__sigdelset (&tmpset, SIGSETXID);
-# endif
set = &tmpset;
}
-#endif
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
diff --git a/sysdeps/unix/sysv/linux/sigwaitinfo.c b/sysdeps/unix/sysv/linux/sigwaitinfo.c
index 5a044f0..0062d3e 100644
--- a/sysdeps/unix/sysv/linux/sigwaitinfo.c
+++ b/sysdeps/unix/sysv/linux/sigwaitinfo.c
@@ -31,25 +31,18 @@
int
__sigwaitinfo (const sigset_t *set, siginfo_t *info)
{
-#ifdef SIGCANCEL
sigset_t tmpset;
if (set != NULL
&& (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
-# ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
-# endif
- ))
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)))
{
/* Create a temporary mask without the bit for SIGCANCEL set. */
// We are not copying more than we have to.
memcpy (&tmpset, set, _NSIG / 8);
__sigdelset (&tmpset, SIGCANCEL);
-# ifdef SIGSETXID
__sigdelset (&tmpset, SIGSETXID);
-# endif
set = &tmpset;
}
-#endif
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */