Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 28 Jan 2003 09:08:07 +0000 (09:08 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 28 Jan 2003 09:08:07 +0000 (09:08 +0000)
2003-01-28  Ulrich Drepper  <drepper@redhat.com>

* sysdeps/unix/common/pause.c (do_pause): New function.  Split
from __libc_pause.  Implement using sigsuspend.
(__libc_pause): Call do_pause to do the real work.

* sysdeps/posix/sigpause.c (do_sigpause): Check range of
sig_or_mask parameter is is_sig != 0.

ChangeLog
sysdeps/posix/sigpause.c
sysdeps/unix/common/pause.c

index 9de63ba..ef422b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-01-28  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/common/pause.c (do_pause): New function.  Split
+       from __libc_pause.  Implement using sigsuspend.
+       (__libc_pause): Call do_pause to do the real work.
+
+       * sysdeps/posix/sigpause.c (do_sigpause): Check range of
+       sig_or_mask parameter is is_sig != 0.
+
 2003-01-21  Philip Blundell  <philb@gnu.org>
 
        * sysdeps/unix/sysv/linux/bits/ioctls.h (SIOCSIFNAME): Define.
index e85a813..bf2ca65 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,94-98,2000,02 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94-98,2000,2002,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,8 @@ do_sigpause (int sig_or_mask, int is_sig)
     {
       /* The modern X/Open implementation is requested.  */
       if (__sigprocmask (0, NULL, &set) < 0
-         /* Yes, we call `sigdelset' and not `__sigdelset'.  */
+         /* Perform the tests from sigdelset ourselves.  */
+         || sig_or_mask <= 0 || sig_or_mask >= NSIG
          || __sigdelset (&set, sig_or_mask) < 0)
        return -1;
     }
index 508a3e0..14b87e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 
 /* Suspend the process until a signal arrives.
    This always returns -1 and sets errno to EINTR.  */
+static void
+do_pause (void)
+{
+  sigset_t set;
+
+  sigemptyset (&set);
+
+  __sigsuspend (&set);
+}
 
 int
 __libc_pause (void)
 {
   if (SINGLE_THREAD_P)
-    return __sigpause (__sigblock (0), 0);
+    {
+      do_pause ();
+      return -1;
+    }
 
   int oldtype = LIBC_CANCEL_ASYNC ();
-  int result = __sigpause (__sigblock (0), 0);
+  (void) do_pause ();
   LIBC_CANCEL_RESET (oldtype);
-  return result;
+  return -1;
 }
 weak_alias (__libc_pause, pause)