apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r583860 - in /apr/apr/branches/1.2.x: CHANGES threadproc/win32/proc.c
Date Thu, 11 Oct 2007 15:50:58 GMT
Author: trawick
Date: Thu Oct 11 08:50:55 2007
New Revision: 583860

URL: http://svn.apache.org/viewvc?rev=583860&view=rev
Log:
backport r583421 from trunk

apr_procattr_io_set() on Windows: Set pipe handles non-blocking as
appropriate based on the input parameters.

PR:           43522
Submitted by: Eric Covener <covener gmail.com>
Reviewed by:  trawick

Modified:
    apr/apr/branches/1.2.x/CHANGES
    apr/apr/branches/1.2.x/threadproc/win32/proc.c

Modified: apr/apr/branches/1.2.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?rev=583860&r1=583859&r2=583860&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.2.x/CHANGES [utf-8] Thu Oct 11 08:50:55 2007
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.2.12
 
+  *) apr_procattr_io_set() on Windows: Set pipe handles non-blocking as
+     appropriate based on the input parameters.  PR 43522.
+     [Eric Covener <covener gmail.com>]
+
   *) apr_file_write() on Windows: Fix return code when writing to a non-
      blocking pipe would have blocked.  PR 43563.
      [Eric Covener <covener gmail.com>]

Modified: apr/apr/branches/1.2.x/threadproc/win32/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/threadproc/win32/proc.c?rev=583860&r1=583859&r2=583860&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/threadproc/win32/proc.c (original)
+++ apr/apr/branches/1.2.x/threadproc/win32/proc.c Thu Oct 11 08:50:55 2007
@@ -90,18 +90,63 @@
 
         stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in,
                                   in, attr->pool);
+        if (stat == APR_SUCCESS) { 
+            switch (in) { 
+                case APR_FULL_BLOCK:
+                    break;
+                case APR_READ_BLOCK:
+                    apr_file_pipe_timeout_set(attr->parent_in, 0);
+                    break;
+                case APR_WRITE_BLOCK:
+                    apr_file_pipe_timeout_set(attr->child_in, 0);
+                    break;
+                default:
+                    apr_file_pipe_timeout_set(attr->child_in, 0);
+                    apr_file_pipe_timeout_set(attr->parent_in, 0);
+            }
+        }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_in);
     }
     if (out && stat == APR_SUCCESS) {
         stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out,
                                   out, attr->pool);
+        if (stat == APR_SUCCESS) { 
+            switch (out) {
+                case APR_FULL_BLOCK:
+                    break;
+                case APR_PARENT_BLOCK:
+                    apr_file_pipe_timeout_set(attr->child_out, 0);
+                    break;
+                case APR_CHILD_BLOCK:
+                    apr_file_pipe_timeout_set(attr->parent_out, 0);
+                    break;
+                default:
+                    apr_file_pipe_timeout_set(attr->child_out, 0);
+                    apr_file_pipe_timeout_set(attr->parent_out, 0);
+            }
+        }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_out);
     }
     if (err && stat == APR_SUCCESS) {
         stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err,
                                   err, attr->pool);
+        if (stat == APR_SUCCESS) { 
+            switch (err) {
+                case APR_FULL_BLOCK:
+                    break;
+                case APR_PARENT_BLOCK:
+                    apr_file_pipe_timeout_set(attr->child_err, 0);
+                    break;
+                case APR_CHILD_BLOCK:
+                    apr_file_pipe_timeout_set(attr->parent_err, 0);
+                    break;
+                default:
+                    apr_file_pipe_timeout_set(attr->child_err, 0);
+                    apr_file_pipe_timeout_set(attr->parent_err, 0);
+            }
+        }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_err);
     }



Mime
View raw message