diff options
author | Christopher Faylor <me@cgf.cx> | 2001-12-27 00:35:16 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-12-27 00:35:16 +0300 |
commit | aaf219f01e5cd7fac54fafae24974e06a737b9ee (patch) | |
tree | 05a51aa38b596ee6cf79693387ff97ec4035ed56 /winsup/cygwin/dcrt0.cc | |
parent | dcd8b9be826107fd74cc91052825730f0f21fb62 (diff) |
* cygmagic: Add define name to warning.
* dcrt0.cc (_dll_crt0): Check for changes in child_info size.
(multiple_cygwin_problem): Avoid "proc" errors when testing. Just assume new
cygwin proc.
* shared_info.h (mount_info): Add 'cb' element for sanity checks.
(shared_info): Ditto.
* child_info.h (child_info): Add fhandler_union_size element for sanity
checking.
* shared.cc (open_shared): Detect shared region size mismatch between parent
and child.
(shared_info::initialize): Detect shared region size mismatch with expectation.
(memory_Init): Ditto.
* sigproc.cc (init_child_info): Correctly set cb in passed structure.
* shared.cc (open_shared):
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index a6a446f5e..c68a2bc12 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -831,20 +831,29 @@ _dll_crt0 () else if (fork_info->intro == PROC_MAGIC_GENERIC && fork_info->magic != CHILD_INFO_MAGIC) multiple_cygwin_problem ("proc", fork_info->magic, CHILD_INFO_MAGIC); + unsigned should_be_cb = 0; switch (fork_info->type) { case _PROC_FORK: user_data->forkee = fork_info->cygpid; + should_be_cb = sizeof (child_info_fork); case _PROC_SPAWN: if (fork_info->pppid_handle) CloseHandle (fork_info->pppid_handle); case _PROC_EXEC: - { - child_proc_info = fork_info; - cygwin_mount_h = child_proc_info->mount_h; - mypid = child_proc_info->cygpid; - break; - } + if (!should_be_cb) + should_be_cb = sizeof (child_info); + if (should_be_cb != fork_info->cb) + multiple_cygwin_problem ("proc size", fork_info->cb, should_be_cb); + else if (sizeof (fhandler_union) != fork_info->fhandler_union_cb) + multiple_cygwin_problem ("fhandler size", fork_info->fhandler_union_cb, sizeof (fhandler_union)); + else + { + child_proc_info = fork_info; + cygwin_mount_h = child_proc_info->mount_h; + mypid = child_proc_info->cygpid; + break; + } default: system_printf ("unknown exec type %d", fork_info->type); fork_info = NULL; @@ -1025,6 +1034,11 @@ __api_fatal (const char *fmt, ...) void multiple_cygwin_problem (const char *what, unsigned magic_version, unsigned version) { + if (_cygwin_testing && strstr (what, "proc")) + { + fork_info = NULL; + return; + } if (CYGWIN_VERSION_MAGIC_VERSION (magic_version) != version) api_fatal ("%s version mismatch detected - %p/%p.\n\ You have multiple copies of cygwin1.dll on your system.\n\ |