You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2021/11/10 13:50:11 UTC

svn commit: r1894916 - in /apr/apr/branches/1.7.x: ./ poll/unix/wakeup.c

Author: ylavic
Date: Wed Nov 10 13:50:10 2021
New Revision: 1894916

URL: http://svn.apache.org/viewvc?rev=1894916&view=rev
Log:
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


Modified:
    apr/apr/branches/1.7.x/   (props changed)
    apr/apr/branches/1.7.x/poll/unix/wakeup.c

Propchange: apr/apr/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1894914

Modified: apr/apr/branches/1.7.x/poll/unix/wakeup.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/poll/unix/wakeup.c?rev=1894916&r1=1894915&r2=1894916&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/poll/unix/wakeup.c (original)
+++ apr/apr/branches/1.7.x/poll/unix/wakeup.c Wed Nov 10 13:50:10 2021
@@ -80,8 +80,9 @@ apr_status_t apr_poll_create_wakeup_pipe
 {
     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;