diff options
author | Christopher Faylor <me@cgf.cx> | 2012-05-07 19:05:56 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-05-07 19:05:56 +0400 |
commit | 06bd0ef2ab50252b81344d6810378b18f49c0e9c (patch) | |
tree | 706b392427696073753a7abd18e00d5615d5acb7 /winsup/cygwin/dcrt0.cc | |
parent | 8620cb792502d89d399064ea038d2b32bc611f45 (diff) |
* DevNotes: Add entry cgf-000003.
* cygheap.h (init_cygheap::pid_handle): Delete.
* dcrt0.cc (child_info_spawn::handle_spawn): Keep parent open if we have
execed.
* pinfo.cc (pinfo::thisproc): Remove pid_handle manipulations.
(pinfo::init): Don't consider a reaped process to be available.
* spawn.cc (child_info_spawn::worker): Remove pid_handle manipulations. Make
wr_proc_pipe and parent noninheritable when starting a program which doesn't
use the Cygwin DLL. Conditionally reset wr_proc_pipe to inheritable if
CreateProcess fails. Inject wr_proc_pipe handle into non-Cygwin process.
Consider a non-cygwin process to be 'synced'.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 63eaa70dd..aea2a564b 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -665,10 +665,15 @@ child_info_spawn::handle_spawn () ready (true); - /* Need to do this after debug_fixup_after_fork_exec or DEBUGGING handling of + /* Keep pointer to parent open if we've execed so that pid will not be reused. + Otherwise, we no longer need this handle so close it. + Need to do this after debug_fixup_after_fork_exec or DEBUGGING handling of handles might get confused. */ - CloseHandle (child_proc_info->parent); - child_proc_info->parent = NULL; + if (type != _CH_EXEC) + { + CloseHandle (child_proc_info->parent); + child_proc_info->parent = NULL; + } signal_fixup_after_exec (); fixup_lockf_after_exec (); |