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-10-19 18:19:37 +0400
committerChristopher Faylor <me@cgf.cx>2005-10-19 18:19:37 +0400
commitb3982520d36f3aedbd579bfe5a9eb208c4943923 (patch)
tree1b7e351ebd5337e5f2a5a05ec6e1c0b15036ab3e /winsup/cygwin/pinfo.cc
parentb72a5c0767780b0280e145c8ad686e007fbea0a5 (diff)
* pinfo.cc (_pinfo::dup_proc_pipe): Make warning more severe by actually
printing it. (_pinfo::alert_parent): Fix comment. Don't send to parent if we are in an exec stub.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 26d910cfe..185475632 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -929,7 +929,7 @@ _pinfo::dup_proc_pipe (HANDLE hProcess)
bool res = DuplicateHandle (hMainProc, wr_proc_pipe, hProcess, &wr_proc_pipe,
0, FALSE, flags);
if (!res && WaitForSingleObject (hProcess, 0) != WAIT_OBJECT_0)
- sigproc_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess);
+ system_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess);
else
{
wr_proc_pipe_owner = dwProcessId;
@@ -990,10 +990,13 @@ bool
_pinfo::alert_parent (char sig)
{
DWORD nb = 0;
- /* Send something to our parent. If the parent has gone away,
- close the pipe. */
- if (wr_proc_pipe == INVALID_HANDLE_VALUE
- || !myself->wr_proc_pipe)
+
+ /* Send something to our parent. If the parent has gone away, close the pipe.
+ Don't send if this is an exec stub.
+
+ FIXME: Is there a race here if we run this while another thread is attempting
+ to exec()? */
+ if (wr_proc_pipe == INVALID_HANDLE_VALUE || !myself->wr_proc_pipe || hExeced)
/* no parent */;
else
{