about summary refs log tree commit diff
path: root/sysdeps/posix/sigpause.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/sigpause.c')
-rw-r--r--sysdeps/posix/sigpause.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sysdeps/posix/sigpause.c b/sysdeps/posix/sigpause.c
index fc5f79e31e..71818740ed 100644
--- a/sysdeps/posix/sigpause.c
+++ b/sysdeps/posix/sigpause.c
@@ -20,13 +20,14 @@
 #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 @@ __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);
 }