aboutsummaryrefslogtreecommitdiff
path: root/threadproc/unix/proc.c
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2002-01-25 02:21:43 +0000
committerJustin Erenkrantz <jerenkrantz@apache.org>2002-01-25 02:21:43 +0000
commit59a51c9ca59fee53b7713a9d92cb6f07fecf7c5a (patch)
treee8276bab5f5e34dbf2e26f3572753f2bbdb7d87d /threadproc/unix/proc.c
parent5048fd054d4620ab748098dd8bf4d03cadd9a458 (diff)
downloadapr-59a51c9ca59fee53b7713a9d92cb6f07fecf7c5a.tar.gz
apr-59a51c9ca59fee53b7713a9d92cb6f07fecf7c5a.zip
Fix leakage with fds with respect to pipes. dup2() should close the old
file descriptor and this new one will be closed when we clean up the pipe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62829 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/unix/proc.c')
-rw-r--r--threadproc/unix/proc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index 0ee409bbf..4872f7508 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -141,10 +141,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi
apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt);
if (child_in != NULL)
- apr_file_dup(&attr->child_in, child_in, attr->cntxt);
+ apr_file_dup2(attr->child_in, child_in, attr->cntxt);
if (parent_in != NULL)
- apr_file_dup(&attr->parent_in, parent_in, attr->cntxt);
+ apr_file_dup2(attr->parent_in, parent_in, attr->cntxt);
return APR_SUCCESS;
}
@@ -157,10 +157,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f
apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt);
if (child_out != NULL)
- apr_file_dup(&attr->child_out, child_out, attr->cntxt);
+ apr_file_dup2(attr->child_out, child_out, attr->cntxt);
if (parent_out != NULL)
- apr_file_dup(&attr->parent_out, parent_out, attr->cntxt);
+ apr_file_dup2(attr->parent_out, parent_out, attr->cntxt);
return APR_SUCCESS;
}
@@ -173,10 +173,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f
apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt);
if (child_err != NULL)
- apr_file_dup(&attr->child_err, child_err, attr->cntxt);
+ apr_file_dup2(attr->child_err, child_err, attr->cntxt);
if (parent_err != NULL)
- apr_file_dup(&attr->parent_err, parent_err, attr->cntxt);
+ apr_file_dup2(attr->parent_err, parent_err, attr->cntxt);
return APR_SUCCESS;
}