Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-09-28 17:55:04 +0400
committerChristopher Faylor <me@cgf.cx>2005-09-28 17:55:04 +0400
commit9edadc960e8bd94cbfd812156fed35557309e2f5 (patch)
treec2631be73646bffa91cfc44b0cccd1800bef6aed
parent43634a4158fb0a17940355b47fc9e30d8d412517 (diff)
* pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process has just
gone away.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/pinfo.cc3
2 files changed, 7 insertions, 1 deletions
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 <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.
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;
}