diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2007-10-14 06:33:14 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2007-10-14 06:33:14 +0000 |
commit | 301aea7411dae0b518eb21a4d5d3d06757fd3b26 (patch) | |
tree | 48676d1601774f453c76a6499a61fed76c45cf46 /threadproc | |
parent | 96698d2f465bc8ea4d3494aeddbe3c4b7c06f3ea (diff) | |
download | libapr-301aea7411dae0b518eb21a4d5d3d06757fd3b26.tar.gz |
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!
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@584496 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/win32/proc.c | 64 |
1 files changed, 9 insertions, 55 deletions
diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index b152a1da3..2c7dcabc8 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -83,10 +83,9 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, 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 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, 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 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, 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 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, 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); |