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>
@@ -80,7 +80,8 @@ 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],
+ if ((rv = apr_file_pipe_create_ex(&wakeup_pipe[0], &wakeup_pipe[1],
+ APR_WRITE_BLOCK,
pool)) != APR_SUCCESS)
return rv;
