diff options
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r-- | sysdeps/unix/sysv/linux/sigwait.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/sigwait.c b/sysdeps/unix/sysv/linux/sigwait.c index e6fb32a610..443c3ad8e1 100644 --- a/sysdeps/unix/sysv/linux/sigwait.c +++ b/sysdeps/unix/sysv/linux/sigwait.c @@ -17,13 +17,20 @@ #include <signal.h> #include <sysdep-cancel.h> +#include <errno.h> int __sigwait (const sigset_t *set, int *sig) { siginfo_t si; - if (__sigtimedwait (set, &si, 0) < 0) - return -1; + int ret; + do + ret = __sigtimedwait (set, &si, 0); + /* Applications do not expect sigwait to return with EINTR, and the + error code is not specified by POSIX. */ + while (ret < 0 && errno == EINTR); + if (ret < 0) + return errno; *sig = si.si_signo; return 0; } |