diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 34fafe533..6df8c85d6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-09-28 Christopher Faylor + + * pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process + has just gone away. + 2005-09-27 Christopher Faylor * init.cc (prime_threads): Make this static, as it should be. diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 2cceb951e..2dd727ba1 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -1040,13 +1040,14 @@ _pinfo::dup_proc_pipe (HANDLE hProcess) flags |= DUPLICATE_CLOSE_SOURCE; bool res = DuplicateHandle (hMainProc, wr_proc_pipe, hProcess, &wr_proc_pipe, 0, FALSE, flags); - if (!res) + if (!res && WaitForSingleObject (hProcess, 0) != WAIT_OBJECT_0) sigproc_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess); else { wr_proc_pipe_owner = dwProcessId; sigproc_printf ("closed wr_proc_pipe %p for pid %d(%u)", wr_proc_pipe, pid, dwProcessId); + res = true; } return res; }