From b3982520d36f3aedbd579bfe5a9eb208c4943923 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 19 Oct 2005 14:19:37 +0000 Subject: [PATCH] * 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. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/pinfo.cc | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4fa3a5e71..22410fa22 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2005-10-19 Christopher Faylor + + * 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. + 2005-10-18 Christopher Faylor * cygtls.cc (handle_threadlist_exception): Improve diagnostic output. 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 { -- 2.43.5