diff options
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 34927c1f0..b3bf304fb 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -34,6 +34,7 @@ details. */ #include "perthread.h" #include "registry.h" #include "environ.h" +#include "cygthread.h" #define LINE_BUF_CHUNK (MAX_PATH * 2) @@ -715,12 +716,13 @@ spawn_guts (const char * prog_arg, const char *const *argv, cygheap_setup_for_child_cleanup (newheap, &ciresrv, 1); if (mode == _P_OVERLAY) ResumeThread (pi.hThread); + cygthread::terminate (); } - if (mode == _P_OVERLAY) - cygpid = myself->pid; - else + if (mode != _P_OVERLAY) cygpid = cygwin_pid (pi.dwProcessId); + else + cygpid = myself->pid; /* We print the original program name here so the user can see that too. */ syscall_printf ("%d = spawn_guts (%s, %.132s)", |