mirror of git://git.musl-libc.org/musl
don't fail with EINTR in sigtimedwait
POSIX allows either behavior, but sigwait is not allowed to fail with EINTR, so the retry loop would have to be in one or the other anyway.
This commit is contained in:
parent
0558683d3d
commit
0a949ebdf0
|
@ -1,12 +1,12 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <errno.h>
|
||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
|
|
||||||
int sigtimedwait(const sigset_t *mask, siginfo_t *si, const struct timespec *timeout)
|
int sigtimedwait(const sigset_t *mask, siginfo_t *si, const struct timespec *timeout)
|
||||||
{
|
{
|
||||||
long k_timeout[2];
|
int ret;
|
||||||
if (timeout) {
|
do {
|
||||||
k_timeout[0] = timeout->tv_sec;
|
ret = syscall4(__NR_rt_sigtimedwait, (long)mask, (long)si, (long)timeout, SYSCALL_SIGSET_SIZE);
|
||||||
k_timeout[1] = timeout->tv_nsec;
|
} while (ret<0 && errno==EINTR);
|
||||||
}
|
return ret;
|
||||||
return syscall4(__NR_rt_sigtimedwait, (long)mask, (long)si, timeout ? (long)k_timeout : 0, SYSCALL_SIGSET_SIZE);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue