summaryrefslogtreecommitdiff
path: root/sysdeps/pthread/lio_listio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/pthread/lio_listio.c')
-rw-r--r--sysdeps/pthread/lio_listio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/pthread/lio_listio.c b/sysdeps/pthread/lio_listio.c
index 62fe2c8f48..1a0db33c23 100644
--- a/sysdeps/pthread/lio_listio.c
+++ b/sysdeps/pthread/lio_listio.c
@@ -157,8 +157,8 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
which we must remove. So defer cancellation for now. */
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
- while (total > 0)
- pthread_cond_wait (&cond, &__aio_requests_mutex);
+ while (total > 0 && result == 0)
+ result = pthread_cond_wait (&cond, &__aio_requests_mutex);
/* Now it's time to restore the cancellation state. */
pthread_setcancelstate (oldstate, NULL);