diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2021-11-10 13:50:10 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2021-11-10 13:50:10 +0000 |
commit | 17fd195179b4987ce3bbb7e0abc4c039af61ba26 (patch) | |
tree | f1048fc2a6568ff5e86b9c4171a19d935d89f8f4 | |
parent | 78eb61a2b8f1fdef480f2a595887e3238d170194 (diff) | |
download | libapr-17fd195179b4987ce3bbb7e0abc4c039af61ba26.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.c | 5 |
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; |