* pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process has just

gone away.
This commit is contained in:
Christopher Faylor 2005-09-28 13:55:04 +00:00
parent 43634a4158
commit 9edadc960e
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-09-28 Christopher Faylor <cgf@timesys.com>
* pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process
has just gone away.
2005-09-27 Christopher Faylor <cgf@timesys.com>
* init.cc (prime_threads): Make this static, as it should be.

View File

@ -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;
}