X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2F__timedwait.c;h=b1d3af2382fa36ba8715c0731c650873512caff6;hb=94a0171d807dc94302d6505041fc58879c27f3bd;hp=b38ea9901ad5080383059b8e4606271262e51797;hpb=685e40bb09f5f24a2af54ea09c97328808f76990;p=musl diff --git a/src/thread/__timedwait.c b/src/thread/__timedwait.c index b38ea990..b1d3af23 100644 --- a/src/thread/__timedwait.c +++ b/src/thread/__timedwait.c @@ -2,7 +2,7 @@ #include #include "futex.h" #include "syscall.h" -#include + int __timedwait(volatile int *addr, int val, clockid_t clk, const struct timespec *at, int priv) { int r; @@ -17,7 +17,7 @@ int __timedwait(volatile int *addr, int val, clockid_t clk, const struct timespe if (to.tv_sec < 0) return ETIMEDOUT; } if (priv) priv = 128; priv=0; - r = __syscall(__NR_futex, (long)addr, FUTEX_WAIT | priv, val, at ? (long)&to : 0); - if (r == ETIMEDOUT) return r; + r = -__syscall(SYS_futex, (long)addr, FUTEX_WAIT | priv, val, at ? (long)&to : 0); + if (r == ETIMEDOUT || r == EINTR) return r; return 0; }