diff options
author | Christopher Faylor <me@cgf.cx> | 2004-12-28 01:27:26 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-12-28 01:27:26 +0000 |
commit | 57ba174fa0fd038154f5f24a32cad566796ee2a6 (patch) | |
tree | 2ec65739c0f0ddbf83d1a22d7b1ca635c65c594d /winsup/cygwin/pinfo.cc | |
parent | 432524c16251a6d40716978ac4d0eb1188b1256a (diff) | |
download | cygnal-57ba174fa0fd038154f5f24a32cad566796ee2a6.tar.gz cygnal-57ba174fa0fd038154f5f24a32cad566796ee2a6.tar.bz2 cygnal-57ba174fa0fd038154f5f24a32cad566796ee2a6.zip |
* cygthread.cc (cygthread::stub): Add better debug output.
(cygthread::cygthread): Ditto.
(cygthread::terminate_thread): Ditto. Move inuse test earlier or suffer
infinite loop.
* pinfo.cc (_pinfo::dup_proc_pipe): Close handle if DuplicateHandle fails and
process no longer exists.
* spawn.cc (spawn_guts): Create process in suspended state if OS demands it.
* wincap.cc: Add "start_proc_suspended" throughout.
* wincap.h (wincaps): Ditto.
(wincapc): Ditto.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 1137575c3..edeb35e00 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -128,7 +128,7 @@ _pinfo::exit (UINT n, bool norecord) } } - sigproc_printf ("Calling ExitProcess norecord %d, n %d, exitcode %d", + sigproc_printf ("Calling ExitProcess norecord %d, n %p, exitcode %p", norecord, n, exitcode); _my_tls.stacklock = 0; _my_tls.stackptr = _my_tls.stack; @@ -768,7 +768,11 @@ _pinfo::dup_proc_pipe (HANDLE hProcess) 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); if (!res) - sigproc_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess); + { + if (WaitForSingleObject (hProcess, 0) == WAIT_OBJECT_0) + CloseHandle (wr_proc_pipe); + sigproc_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess); + } else { wr_proc_pipe_owner = dwProcessId; |