summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-11-10 13:50:10 +0000
committerYann Ylavic <ylavic@apache.org>2021-11-10 13:50:10 +0000
commit47b951ba3fbe191dcfb5422ea5da4fc0d2d2d019 (patch)
treef1048fc2a6568ff5e86b9c4171a19d935d89f8f4
parentdc96ecd50307f481ea7ecbe29dd1f54b974e3bc9 (diff)
downloadapr-47b951ba3fbe191dcfb5422ea5da4fc0d2d2d019.tar.gz
Merge r1894914 from trunk:
poll: Fix possible blocking when draining the wakeup pipe. apr_poll_drain_wakeup_pipe() can block if exactly 512 bytes (or multiple thereof) are available on the drained pipe, fix this by setting read end of the pipe nonblocking (the write end is still blocking). Submitted by: Mihaly Szjatinya <mihaly.szjatinya nxlog.org> Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1894916 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poll/unix/wakeup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/poll/unix/wakeup.c b/poll/unix/wakeup.c
index acf8afc97..6c3dcd6fb 100644
--- a/poll/unix/wakeup.c
+++ b/poll/unix/wakeup.c
@@ -80,8 +80,9 @@ apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd,
{
apr_status_t rv;
- if ((rv = apr_file_pipe_create(&wakeup_pipe[0], &wakeup_pipe[1],
- pool)) != APR_SUCCESS)
+ if ((rv = apr_file_pipe_create_ex(&wakeup_pipe[0], &wakeup_pipe[1],
+ APR_WRITE_BLOCK,
+ pool)) != APR_SUCCESS)
return rv;
pfd->p = pool;