about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-17 08:58:31 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-17 08:58:31 +0000
commitbbde852717f9db0b39190ab5774204522569239b (patch)
treefed5fa0d3f6d466fab513f87ee3338d5149519d4 /sysdeps/unix/sysv
parent2667645020a4322a2730e340302748f1b0c1a1ce (diff)
downloadglibc-bbde852717f9db0b39190ab5774204522569239b.tar.gz
glibc-bbde852717f9db0b39190ab5774204522569239b.tar.xz
glibc-bbde852717f9db0b39190ab5774204522569239b.zip
Update.
2003-06-17  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/sleep.c: Use CANCELLATION_P if defined before
	returning because seconds==0.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/sleep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/sleep.c b/sysdeps/unix/sysv/linux/sleep.c
index ae24afe1ae..ac92f6eced 100644
--- a/sysdeps/unix/sysv/linux/sleep.c
+++ b/sysdeps/unix/sysv/linux/sleep.c
@@ -24,7 +24,7 @@
 #include <unistd.h>
 
 /* We are going to use the `nanosleep' syscall of the kernel.  But the
-   kernel does not implement the sstupid SysV SIGCHLD vs. SIG_IGN
+   kernel does not implement the stupid SysV SIGCHLD vs. SIG_IGN
    behaviour for this syscall.  Therefore we have to emulate it here.  */
 unsigned int
 __sleep (unsigned int seconds)
@@ -35,7 +35,12 @@ __sleep (unsigned int seconds)
 
   /* This is not necessary but some buggy programs depend on this.  */
   if (seconds == 0)
-    return 0;
+    {
+#ifdef CANCELLATION_P
+      CANCELLATION_P (THREAD_SELF);
+#endif
+      return 0;
+    }
 
   /* Linux will wake up the system call, nanosleep, when SIGCHLD
      arrives even if SIGCHLD is ignored.  We have to deal with it