summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/pinfo.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-07-24 19:18:58 +0000
committerChristopher Faylor <me@cgf.cx>2004-07-24 19:18:58 +0000
commit634d51d94ec5b563880787ba8dddf0add5771ee9 (patch)
tree7005e3e5abf58e5c5a56b86d8965e502c557b902 /winsup/cygwin/pinfo.cc
parent8c2defa46cb2887a609764ef5e52df8dbdde21d0 (diff)
downloadcygnal-634d51d94ec5b563880787ba8dddf0add5771ee9.tar.gz
cygnal-634d51d94ec5b563880787ba8dddf0add5771ee9.tar.bz2
cygnal-634d51d94ec5b563880787ba8dddf0add5771ee9.zip
* dcrt0.cc (dll_crt0_0): Use proper boolean arguments.
* pinfo.cc (pinfo::init): Don't consider MapViewOfFileEx error to be fatal if exiting. * pinfo.h (pinfo::init): Eliminate default argument and supply the argument in the one case that needed it.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index dcbdf27ca..82ea74d32 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -193,8 +193,25 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
}
procinfo = (_pinfo *) MapViewOfFileEx (h, access, 0, 0, 0, mapaddr);
- if (!procinfo)
- api_fatal ("MapViewOfFileEx(%p) failed, %E", h);
+ if (procinfo)
+ /* it worked */;
+ else if (exit_state)
+ return; /* exiting */
+ else
+ {
+ if (GetLastError () == ERROR_INVALID_HANDLE)
+ api_fatal ("MapViewOfFileEx(%p, in_h %p) failed, %E", h, in_h);
+ else
+ {
+ debug_printf ("MapViewOfFileEx(%p, in_h %p) failed, %E", h, in_h);
+ CloseHandle (h);
+ }
+ if (i < 9)
+ continue;
+ else
+ return;
+ }
+
ProtectHandle1 (h, pinfo_shared_handle);
if ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR)