summaryrefslogtreecommitdiff
path: root/libc/unistd
diff options
context:
space:
mode:
Diffstat (limited to 'libc/unistd')
-rw-r--r--libc/unistd/sleep.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/unistd/sleep.c b/libc/unistd/sleep.c
index 0c0416e6d..b0031f022 100644
--- a/libc/unistd/sleep.c
+++ b/libc/unistd/sleep.c
@@ -54,7 +54,12 @@ unsigned int 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