From: Carlos O'Donell Date: Sun, 10 Aug 2014 14:01:43 +0000 (-0400) Subject: nptl: handle EAGAIN with some futex operations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fgentoo%2F2.19;p=thirdparty%2Fglibc.git nptl: handle EAGAIN with some futex operations --- diff --git a/nptl/sysdeps/pthread/aio_misc.h b/nptl/sysdeps/pthread/aio_misc.h index ac3488c57e8..ac3577106fe 100644 --- a/nptl/sysdeps/pthread/aio_misc.h +++ b/nptl/sysdeps/pthread/aio_misc.h @@ -50,7 +50,7 @@ { \ status = lll_futex_timed_wait (futexaddr, oldval, timeout, \ LLL_PRIVATE); \ - if (status != -EWOULDBLOCK) \ + if (status != -EWOULDBLOCK && status != -EAGAIN) \ break; \ \ oldval = *futexaddr; \ @@ -65,7 +65,7 @@ else if (status == -ETIMEDOUT) \ result = EAGAIN; \ else \ - assert (status == 0 || status == -EWOULDBLOCK); \ + assert (status == 0 || status == -EWOULDBLOCK || status == -EAGAIN);\ \ pthread_mutex_lock (&__aio_requests_mutex); \ } \ diff --git a/nptl/sysdeps/pthread/gai_misc.h b/nptl/sysdeps/pthread/gai_misc.h index 946275ed752..aa72c4af7cf 100644 --- a/nptl/sysdeps/pthread/gai_misc.h +++ b/nptl/sysdeps/pthread/gai_misc.h @@ -51,7 +51,7 @@ { \ status = lll_futex_timed_wait (futexaddr, oldval, timeout, \ LLL_PRIVATE); \ - if (status != -EWOULDBLOCK) \ + if (status != -EWOULDBLOCK && status != -EAGAIN) \ break; \ \ oldval = *futexaddr; \ @@ -66,7 +66,7 @@ else if (status == -ETIMEDOUT) \ result = EAGAIN; \ else \ - assert (status == 0 || status == -EWOULDBLOCK); \ + assert (status == 0 || status == -EWOULDBLOCK || status == -EAGAIN);\ \ pthread_mutex_lock (&__gai_requests_mutex); \ } \ diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c index 1b6a20b8266..41ac54b324a 100644 --- a/sunrpc/clnt_udp.c +++ b/sunrpc/clnt_udp.c @@ -463,7 +463,7 @@ send_again: while (inlen < 0 && errno == EINTR); if (inlen < 0) { - if (errno == EWOULDBLOCK) + if (errno == EWOULDBLOCK || errno == EAGAIN) continue; cu->cu_error.re_errno = errno; return (cu->cu_error.re_status = RPC_CANTRECV);