summaryrefslogtreecommitdiff
path: root/poll
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-11-10 13:37:38 +0000
committerYann Ylavic <ylavic@apache.org>2021-11-10 13:37:38 +0000
commitbf0de404d551a9badd07eff606ae37c7d5501d9e (patch)
tree6d38bdad81cd9b86dcb7d7358572e2b6ecf79315 /poll
parent42952002b38f4f6ec38bb7d81bf213231ec724c6 (diff)
downloadapr-bf0de404d551a9badd07eff606ae37c7d5501d9e.tar.gz
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/trunk@1894914 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-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 f8ea06048..7c4d4247a 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;