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>2004-07-24 23:18:58 +0400
committerChristopher Faylor <me@cgf.cx>2004-07-24 23:18:58 +0400
commit634d51d94ec5b563880787ba8dddf0add5771ee9 (patch)
tree7005e3e5abf58e5c5a56b86d8965e502c557b902
parent8c2defa46cb2887a609764ef5e52df8dbdde21d0 (diff)
* 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.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/dcrt0.cc6
-rw-r--r--winsup/cygwin/pinfo.cc21
-rw-r--r--winsup/cygwin/pinfo.h6
4 files changed, 33 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bb6d29753..2907f16fd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-24 Christopher Faylor <cgf@timesys.com>
+
+ * 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.
+
2004-07-24 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <cgf@timesys.com>
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 6f99403b0..93568f5fd 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -665,7 +665,7 @@ dll_crt0_0 ()
{
case _PROC_FORK:
alloc_stack (fork_info);
- cygheap_fixup_in_child (0);
+ cygheap_fixup_in_child (false);
memory_init ();
set_myself (mypid);
close_ppid_handle = !!child_proc_info->pppid_handle;
@@ -679,11 +679,11 @@ dll_crt0_0 ()
hexec_proc = spawn_info->hexec_proc;
around:
HANDLE h;
- cygheap_fixup_in_child (1);
+ cygheap_fixup_in_child (true);
memory_init ();
if (!spawn_info->moreinfo->myself_pinfo ||
!DuplicateHandle (hMainProc, spawn_info->moreinfo->myself_pinfo,
- hMainProc, &h, 0, 0,
+ hMainProc, &h, 0, FALSE,
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
h = NULL;
set_myself (mypid, h);
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)
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index 923b0bec7..5cf632f18 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -129,11 +129,11 @@ class pinfo
_pinfo *procinfo;
bool destroy;
public:
- void init (pid_t n, DWORD create = 0, HANDLE h = NULL) __attribute__ ((regparm(3)));
+ void init (pid_t, DWORD, HANDLE = NULL) __attribute__ ((regparm(3)));
pinfo () {}
pinfo (_pinfo *x): procinfo (x) {}
- pinfo (pid_t n) {init (n);}
- pinfo (pid_t n, int create) {init (n, create);}
+ pinfo (pid_t n) {init (n, 0);}
+ pinfo (pid_t n, DWORD flag) {init (n, flag);}
void release ();
~pinfo ()
{