From 23197752739c82be1d0bf3eda9b1ef6647328816 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 28 Mar 2007 14:34:24 +0000 Subject: * spawn.cc (spawn_guts): Start pure-windows processes in a suspended state to avoid potential DuplicateHandle problems. --- winsup/cygwin/spawn.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'winsup/cygwin/spawn.cc') diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 510ed210d..69a904314 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -455,7 +455,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, So we have to start the child in suspend state, unfortunately, to avoid a race condition. */ if (!newargv.win16_exe - && (mode != _P_OVERLAY || cygheap->fdtab.need_fixup_before ())) + && (!ch.iscygwin () || mode != _P_OVERLAY || cygheap->fdtab.need_fixup_before ())) c_flags |= CREATE_SUSPENDED; runpath = null_app_name ? NULL : (const char *) real_path; @@ -609,11 +609,9 @@ loop: if (!newargv.win16_exe && myself->wr_proc_pipe) { if (!looped) - { - myself->sync_proc_pipe (); /* Make sure that we own wr_proc_pipe - just in case we've been previously - execed. */ - } + myself->sync_proc_pipe (); /* Make sure that we own wr_proc_pipe + just in case we've been previously + execed. */ orig_wr_proc_pipe = myself->dup_proc_pipe (pi.hProcess); } pid = myself->pid; -- cgit v1.2.3