diff options
author | Christopher Faylor <me@cgf.cx> | 2006-03-27 07:52:24 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-03-27 07:52:24 +0400 |
commit | 8b9fb6fffda4c97d417eb95100db32eb3520d4d7 (patch) | |
tree | 25e7f1158ad6643aef78ccfe38343f5a76887ded /winsup/cygwin | |
parent | ec54178c36ea087420badce9f38cbc7456f16ca4 (diff) |
* spawn.cc (spawn_guts): Close handles if we know that we will not be seeing a
sync event from the child.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 20 |
2 files changed, 16 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 135bccb57..16dc01e64 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2006-03-26 Christopher Faylor <cgf@timesys.com> + * spawn.cc (spawn_guts): Close handles if we know that we will not be + seeing a sync event from the child. + +2006-03-26 Christopher Faylor <cgf@timesys.com> + * sigproc.cc (wait_sig): Move myself manipulation... (wait_for_sigthread): ...to here. diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index d61fb5984..5b736b2c6 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -600,12 +600,12 @@ spawn_guts (const char * prog_arg, const char *const *argv, si.wShowWindow = SW_HIDE; } - int flags = GetPriorityClass (hMainProc); - sigproc_printf ("priority class %d", flags); - flags |= CREATE_SEPARATE_WOW_VDM; + int c_flags = GetPriorityClass (hMainProc); + sigproc_printf ("priority class %d", c_flags); + c_flags |= CREATE_SEPARATE_WOW_VDM; if (mode == _P_DETACH) - flags |= DETACHED_PROCESS; + c_flags |= DETACHED_PROCESS; if (mode != _P_OVERLAY) myself->exec_sendsig = NULL; @@ -642,7 +642,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, if (!newargv.win16_exe && (wincap.start_proc_suspended () || mode != _P_OVERLAY || cygheap->fdtab.need_fixup_before ())) - flags |= CREATE_SUSPENDED; + c_flags |= CREATE_SUSPENDED; const char *runpath = null_app_name ? NULL : (const char *) real_path; @@ -683,7 +683,7 @@ loop: &sec_none_nih,/* process security attrs */ &sec_none_nih,/* thread security attrs */ TRUE, /* inherit handles from parent */ - flags, + c_flags, envblock, /* environment */ 0, /* use current drive/directory */ &si, @@ -718,7 +718,7 @@ loop: &sec_none_nih, /* process security attrs */ &sec_none_nih, /* thread security attrs */ TRUE, /* inherit handles from parent */ - flags, + c_flags, envblock, /* environment */ 0, /* use current drive/directory */ &si, @@ -749,7 +749,7 @@ loop: goto out; } - if (!(flags & CREATE_SUSPENDED)) + if (!(c_flags & CREATE_SUSPENDED)) strace.write_childpid (ch, pi.dwProcessId); /* Fixup the parent data structures if needed and resume the child's @@ -801,6 +801,8 @@ loop: orig_wr_proc_pipe = myself->dup_proc_pipe (pi.hProcess); } pid = myself->pid; + if (!ch.iscygwin ()) + close_all_files (); } else { @@ -840,7 +842,7 @@ loop: } /* Start the child running */ - if (flags & CREATE_SUSPENDED) + if (c_flags & CREATE_SUSPENDED) { ResumeThread (pi.hThread); strace.write_childpid (ch, pi.dwProcessId); |