diff options
author | Christopher Faylor <me@cgf.cx> | 2005-09-05 17:30:04 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-09-05 17:30:04 +0000 |
commit | a743e3b94089a13f47b3294e91027cecbf29fe0f (patch) | |
tree | e60d29c389beb2a11a62a1dfb50d4fe69ab5059a /winsup/cygwin/fork.cc | |
parent | bf58ec35b4e79aa656b057bc754b64fe39e270da (diff) | |
download | cygnal-a743e3b94089a13f47b3294e91027cecbf29fe0f.tar.gz cygnal-a743e3b94089a13f47b3294e91027cecbf29fe0f.tar.bz2 cygnal-a743e3b94089a13f47b3294e91027cecbf29fe0f.zip |
* cygheap.cc (cygheap_init): Eliminate debugging #if.
* fork.cc (fork_parent): Don't issue errors if "somebody" has set the
PID_EXITED flag on a child. Don't close process handle if it has potentially
already been closed.
* pinfo.cc (winpids::add): Eliminate PID_ALLPIDS handling which was obsoleted
by previous changes.
* spawn.cc (av::fixup): Do win16 detection for .com files. Make sure that
buffer has been unmapped in all cases.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r-- | winsup/cygwin/fork.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 785aabd4f..f16eabc32 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -283,8 +283,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_ pthread::atforkprepare (); - int c_flags = GetPriorityClass (hMainProc) /*| - CREATE_NEW_PROCESS_GROUP*/; + int c_flags = GetPriorityClass (hMainProc); STARTUPINFO si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL}; /* If we don't have a console, then don't create a console for the @@ -336,7 +335,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_ /* Remove impersonation */ cygheap->user.deimpersonate (); - syscall_printf ("CreateProcess (%s, %s, 0, 0, 1, %x, 0, 0, %p, %p)", + syscall_printf ("CreateProcess (%s, %s, 0, 0, 1, %p, 0, 0, %p, %p)", myself->progname, myself->progname, c_flags, &si, &pi); bool locked = __malloc_lock (); rc = CreateProcess (myself->progname, /* image to run */ @@ -418,7 +417,8 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_ /* Wait for subproc to initialize itself. */ if (!ch.sync (child->pid, pi.hProcess, FORK_WAIT_TIMEOUT)) { - system_printf ("child %d died waiting for longjmp before initialization", child_pid); + if (NOTSTATE (child, PID_EXITED)) + system_printf ("child %d died waiting for longjmp before initialization", child_pid); goto cleanup; } @@ -469,7 +469,8 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_ goto cleanup; else if (!ch.sync (child->pid, pi.hProcess, FORK_WAIT_TIMEOUT)) { - system_printf ("child %d died waiting for dll loading", child_pid); + if (NOTSTATE (child, PID_EXITED)) + system_printf ("child %d died waiting for dll loading", child_pid); goto cleanup; } @@ -506,7 +507,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_ __malloc_unlock (); /* Remember to de-allocate the fd table. */ - if (pi.hProcess) + if (pi.hProcess && !child.hProcess) ForceCloseHandle1 (pi.hProcess, childhProc); if (pi.hThread) ForceCloseHandle (pi.hThread); |