diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-12-01 07:40:02 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-12-01 07:40:02 +0000 |
commit | 9e25f3a5c5892d3a9a792d9c95dc32b7561c1895 (patch) | |
tree | 572237c735b607e84ee2fbe7ad937898499c0ac1 /libc/signal/sigpause.c | |
parent | 592add99c335354bd84367614acbcc9febd86309 (diff) |
sync with glibc (and shrinks the object code nicely by like half)
Diffstat (limited to 'libc/signal/sigpause.c')
-rw-r--r-- | libc/signal/sigpause.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/libc/signal/sigpause.c b/libc/signal/sigpause.c index dd05e6e0a..e25803a9b 100644 --- a/libc/signal/sigpause.c +++ b/libc/signal/sigpause.c @@ -21,12 +21,13 @@ #include <signal.h> #include <stddef.h> /* For NULL. */ +#include "sigset-cvt-mask.h" + /* Set the mask of blocked signals to MASK, wait for a signal to arrive, and then restore the mask. */ int __sigpause (int sig_or_mask, int is_sig) { sigset_t set; - int sig; if (is_sig != 0) { @@ -36,20 +37,8 @@ int __sigpause (int sig_or_mask, int is_sig) || sigdelset (&set, sig_or_mask) < 0) return -1; } - else - { - if (sigemptyset (&set) < 0) - return -1; - - if (sizeof (sig_or_mask) == sizeof (set)) - *(int *) &set = sig_or_mask; - else if (sizeof (unsigned long int) == sizeof (set)) - *(unsigned long int *) &set = (unsigned int) sig_or_mask; - else - for (sig = 1; sig < NSIG; ++sig) - if ((sig_or_mask & sigmask (sig)) && __sigaddset (&set, sig) < 0) - return -1; - } + else if (sigset_set_old_mask (&set, sig_or_mask) < 0) + return -1; return sigsuspend (&set); } |