diff options
author | Christopher Faylor <me@cgf.cx> | 2000-10-20 04:20:21 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-10-20 04:20:21 +0000 |
commit | a333dca2b8911e7cb09ab7ff38692ae879e8b67a (patch) | |
tree | ba6895c1454afb8650eb6704b0d3ef0611c44574 /winsup/cygwin/pinfo.cc | |
parent | 74266a0fee830ed4162d10e253c872f349511a23 (diff) | |
download | cygnal-a333dca2b8911e7cb09ab7ff38692ae879e8b67a.tar.gz cygnal-a333dca2b8911e7cb09ab7ff38692ae879e8b67a.tar.bz2 cygnal-a333dca2b8911e7cb09ab7ff38692ae879e8b67a.zip |
* external.cc (fillout_pinfo): Pass PID_NOREDIR flag to pinfo init to avoid
finding execed processes twice.
* signal.cc (kill_pgrp): Ditto.
* spawn.cc (spawn_guts): Avoid passing first argument to CreateProcess when
running a windows shell so that CreateProcess will locate the shell.
Reorganize so that correct error is returned when CreateProcess fails.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index ce1ebe52f..e1a195c7b 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -163,7 +163,6 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h) } else if (!create) { - /* CGF FIXME -- deal with inheritance after an exec */ h = OpenFileMappingA (FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapname); created = 0; } @@ -185,6 +184,13 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h) procinfo = (_pinfo *) MapViewOfFile (h, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); ProtectHandle1 (h, pinfo_shared_handle); + if ((procinfo->process_state & PID_INITIALIZING) && (create & PID_NOREDIR)) + { + release (); + set_errno (ENOENT); + return; + } + if (procinfo->process_state & PID_EXECED) { assert (!i); @@ -232,6 +238,7 @@ pinfo::release () if (((DWORD) procinfo & 0x77000000) == 0x61000000) try_to_debug (); #endif UnmapViewOfFile (procinfo); + procinfo = NULL; ForceCloseHandle1 (h, pinfo_shared_handle); h = NULL; } |