From dfd5d5bea614c4ce80ea90e73a0d47d071e3efa1 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 8 May 2012 15:06:43 +0000 Subject: * DevNotes: Add entry cgf-000004. * pinfo.cc (pinfo::init): Reuse shared memory if the state is marked with PID_REAPED. * spawn.cc (child_info_spawn::worker): Don't duplicate myself_pinfo into non-cygwin child. * fork.cc (frok::parent): Improve error output. --- winsup/cygwin/spawn.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/spawn.cc') diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 8b5e382c5..7e165cf8b 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -422,10 +422,10 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, moreinfo->argc = newargv.argc; moreinfo->argv = newargv; - if (mode != _P_OVERLAY || - !DuplicateHandle (GetCurrentProcess (), myself.shared_handle (), - GetCurrentProcess (), &moreinfo->myself_pinfo, - 0, TRUE, DUPLICATE_SAME_ACCESS)) + if (mode != _P_OVERLAY || !real_path.iscygexec () + || !DuplicateHandle (GetCurrentProcess (), myself.shared_handle (), + GetCurrentProcess (), &moreinfo->myself_pinfo, + 0, TRUE, DUPLICATE_SAME_ACCESS)) moreinfo->myself_pinfo = NULL; else VerifyHandle (moreinfo->myself_pinfo); @@ -740,7 +740,7 @@ loop: process fails. Only need to do this for _P_OVERLAY since the handle will be closed otherwise. Don't need to do this for 'parent' since it will be closed in every case. See FIXME above. */ - if (!real_path.iscygexec () && mode == _P_OVERLAY) + if (!iscygwin () && mode == _P_OVERLAY) SetHandleInformation (wr_proc_pipe, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT); if (wr_proc_pipe == my_wr_proc_pipe) wr_proc_pipe = NULL; /* We still own it: don't nuke in destructor */ -- cgit v1.2.3