trawick 01/10/26 11:13:02
Modified: threadproc/unix proc.c
Log:
apr_proc_create():
do exec cleanup before duping pipes to fds 0-2; otherwise,
any files cleaned up with those fds will hose our pipes;
typical symptom is APR_EOF in the parent when trying to read
child output
Revision Changes Path
1.51 +6 -2 apr/threadproc/unix/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/unix/proc.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- proc.c 2001/10/23 17:30:08 1.50
+++ proc.c 2001/10/26 18:13:02 1.51
@@ -289,6 +289,12 @@
else if (new->pid == 0) {
int status;
/* child process */
+
+ /* do exec cleanup before duping pipes to fds 0-2; otherwise,
+ * any files cleaned up with those fds will hose our pipes
+ */
+ apr_pool_cleanup_for_exec();
+
if (attr->child_in) {
apr_file_close(attr->parent_in);
dup2(attr->child_in->filedes, STDIN_FILENO);
@@ -312,8 +318,6 @@
exit(-1); /* We have big problems, the child should exit.
*/
}
}
-
- apr_pool_cleanup_for_exec();
if ((status = limit_proc(attr)) != APR_SUCCESS) {
return status;