Author: bjh
Date: Wed Oct 31 15:06:10 2007
New Revision: 590848
URL: http://svn.apache.org/viewvc?rev=590848&view=rev
Log:
OS/2: Fix condition for restoring std handles after spawning a process.
We still need to restore the std handles if "no file" (filedes == -1)
is passed to the child.
Modified:
apr/apr/trunk/threadproc/os2/proc.c
Modified: apr/apr/trunk/threadproc/os2/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/os2/proc.c?rev=590848&r1=590847&r2=590848&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/os2/proc.c (original)
+++ apr/apr/trunk/threadproc/os2/proc.c Wed Oct 31 15:06:10 2007
@@ -503,22 +503,31 @@
chdir(savedir);
}
- if (attr->child_in && (attr->child_in->filedes != -1)) {
- apr_file_close(attr->child_in);
+ if (attr->child_in) {
+ if (attr->child_in->filedes != -1) {
+ apr_file_close(attr->child_in);
+ }
+
dup = STDIN_FILENO;
DosDupHandle(save_in, &dup);
DosClose(save_in);
}
- if (attr->child_out && attr->child_err->filedes != -1) {
- apr_file_close(attr->child_out);
+ if (attr->child_out) {
+ if (attr->child_err->filedes != -1) {
+ apr_file_close(attr->child_out);
+ }
+
dup = STDOUT_FILENO;
DosDupHandle(save_out, &dup);
DosClose(save_out);
}
- if (attr->child_err && attr->child_err->filedes != -1) {
- apr_file_close(attr->child_err);
+ if (attr->child_err) {
+ if (attr->child_err->filedes != -1) {
+ apr_file_close(attr->child_err);
+ }
+
dup = STDERR_FILENO;
DosDupHandle(save_err, &dup);
DosClose(save_err);
|