From 9559080132dcd991176e5eb48604405e610534d1 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Sun, 10 Aug 2014 10:01:43 -0400 Subject: nptl: handle EAGAIN with some futex operations --- nptl/sysdeps/pthread/aio_misc.h | 4 ++-- nptl/sysdeps/pthread/gai_misc.h | 4 ++-- sunrpc/clnt_udp.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nptl/sysdeps/pthread/aio_misc.h b/nptl/sysdeps/pthread/aio_misc.h index ac3488c57e..ac3577106f 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 946275ed75..aa72c4af7c 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 1b6a20b826..41ac54b324 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); -- cgit 1.4.1