From bbde852717f9db0b39190ab5774204522569239b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Jun 2003 08:58:31 +0000 Subject: Update. 2003-06-17 Ulrich Drepper * sysdeps/unix/sysv/linux/sleep.c: Use CANCELLATION_P if defined before returning because seconds==0. --- sysdeps/unix/sysv/linux/sleep.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv') 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 /* 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 -- cgit v1.2.3-70-g09d2