apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r584496 - /apr/apr/trunk/threadproc/win32/proc.c
Date Sun, 14 Oct 2007 06:33:16 GMT
Author: wrowe
Date: Sat Oct 13 23:33:14 2007
New Revision: 584496

URL: http://svn.apache.org/viewvc?rev=584496&view=rev
Log:
With the correction of setting ->timeout = 0 way up in the
apr_file_pipe_create_ex() for win32, many lines are redundant.
Thanks to Eric for picking up on this mess in the first place!

Modified:
    apr/apr/trunk/threadproc/win32/proc.c

Modified: apr/apr/trunk/threadproc/win32/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/win32/proc.c?rev=584496&r1=584495&r2=584496&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/win32/proc.c (original)
+++ apr/apr/trunk/threadproc/win32/proc.c Sat Oct 13 23:33:14 2007
@@ -83,10 +83,9 @@
 
     if (in) {
         /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while
-         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so we
-         * must transpose the CHILD/PARENT blocking flags
-         * only for the stdin pipe.  stdout/stderr naturally
-         * map to the correct mode.
+         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so transpose 
+         * the CHILD/PARENT blocking flags for the stdin pipe.
+         * stdout/stderr map to the correct mode by default.
          */
         if (in == APR_CHILD_BLOCK)
             in = APR_READ_BLOCK;
@@ -96,23 +95,8 @@
         if (in == APR_NO_FILE)
             attr->child_in = &no_file;
         else { 
-            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);
-                }
-            }
+            stat = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
+                                           in, attr->pool);
         }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_in);
@@ -121,23 +105,8 @@
         if (out == APR_NO_FILE)
             attr->child_out = &no_file;
         else { 
-            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);
-                }
-            }
+            stat = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
+                                           out, attr->pool);
         }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_out);
@@ -146,23 +115,8 @@
         if (err == APR_NO_FILE)
             attr->child_err = &no_file;
         else { 
-            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);
-                }
-            }
+            stat = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
+                                           err, attr->pool);
         }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_err);



Mime
View raw message