From 634d51d94ec5b563880787ba8dddf0add5771ee9 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 24 Jul 2004 19:18:58 +0000 Subject: * 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. --- winsup/cygwin/pinfo.cc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/pinfo.cc') 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) -- cgit v1.2.3