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>2006-03-21 04:37:25 +0300
committerChristopher Faylor <me@cgf.cx>2006-03-21 04:37:25 +0300
commitd4d63ebf22e0738e4a88f0ad53cb4e0e87ef92e3 (patch)
treef0a81671dce7a0901b26b958fff4a329b000c8d3 /winsup/cygwin/pinfo.cc
parent3078fb4f360e44b436bafcd9e7c51f26792e34b4 (diff)
* dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.
* pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure. Return previous pipe handle. * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value. * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if process exits before synchronization.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index cc64e2f81..6c9cdab16 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -925,7 +925,7 @@ proc_waiter (void *arg)
return 0;
}
-bool
+HANDLE
_pinfo::dup_proc_pipe (HANDLE hProcess)
{
DWORD flags = DUPLICATE_SAME_ACCESS;
@@ -938,8 +938,11 @@ _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)
- system_printf ("DuplicateHandle failed, pid %d, hProcess %p, wr_proc_pipe %p, %E",
- pid, hProcess, orig_wr_proc_pipe);
+ {
+ wr_proc_pipe = orig_wr_proc_pipe;
+ system_printf ("DuplicateHandle failed, pid %d, hProcess %p, wr_proc_pipe %p, %E",
+ pid, hProcess, wr_proc_pipe);
+ }
else
{
wr_proc_pipe_owner = dwProcessId;
@@ -947,7 +950,7 @@ _pinfo::dup_proc_pipe (HANDLE hProcess)
pid, dwProcessId);
res = true;
}
- return res;
+ return orig_wr_proc_pipe;
}
/* function to set up the process pipe and kick off proc_waiter */