diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2007-10-10 10:38:39 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2007-10-10 10:38:39 +0000 |
commit | b602ec394d2ba6a80fed617f6269524cb7d0fdee (patch) | |
tree | 7aa689b5411035e2578f2fca5eab511523b70a40 /threadproc | |
parent | 748e36294cce6235ddd4a5f288c96e5683e462e9 (diff) | |
download | libapr-b602ec394d2ba6a80fed617f6269524cb7d0fdee.tar.gz |
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
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@583421 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/win32/proc.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c7f2408e9..b152a1da3 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -95,27 +95,75 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, if (in == APR_NO_FILE) attr->child_in = &no_file; - else + 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); + } + } + } if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { if (out == APR_NO_FILE) attr->child_out = &no_file; - else + 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); + } + } + } if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { if (err == APR_NO_FILE) attr->child_err = &no_file; - else + 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); + } + } + } if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_err); } |