diff options
author | Christopher Faylor <me@cgf.cx> | 2001-12-26 21:35:16 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-12-26 21:35:16 +0000 |
commit | aaf219f01e5cd7fac54fafae24974e06a737b9ee (patch) | |
tree | 05a51aa38b596ee6cf79693387ff97ec4035ed56 /winsup/cygwin/shared.cc | |
parent | dcd8b9be826107fd74cc91052825730f0f21fb62 (diff) | |
download | cygnal-aaf219f01e5cd7fac54fafae24974e06a737b9ee.tar.gz cygnal-aaf219f01e5cd7fac54fafae24974e06a737b9ee.tar.bz2 cygnal-aaf219f01e5cd7fac54fafae24974e06a737b9ee.zip |
* 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/shared.cc')
-rw-r--r-- | winsup/cygwin/shared.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index db99b0737..f10fd7f10 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -103,10 +103,12 @@ open_shared (const char *name, int n, HANDLE &shared_h, DWORD size, void *addr) void shared_info::initialize () { - if (inited) + if (version) { - if (inited != SHARED_VERSION_MAGIC) - multiple_cygwin_problem ("shared", inited, SHARED_VERSION); + if (version != SHARED_VERSION_MAGIC) + multiple_cygwin_problem ("shared", version, SHARED_VERSION); + else if (cb != SHARED_INFO_CB) + multiple_cygwin_problem ("shared size", cb, SHARED_INFO_CB); return; } @@ -115,7 +117,11 @@ shared_info::initialize () /* Initialize tty table. */ tty.init (); - inited = SHARED_VERSION_MAGIC; + version = SHARED_VERSION_MAGIC; + cb = sizeof (*this); + if (cb != SHARED_INFO_CB) + system_printf ("size of shared memory region changed from %u to %u", + SHARED_INFO_CB, cb); } void __stdcall @@ -162,10 +168,16 @@ memory_init () { mount_table->version = MOUNT_VERSION_MAGIC; debug_printf ("initializing mount table"); + mount_table->cb = sizeof (*mount_table); + if (mount_table->cb != MOUNT_INFO_CB) + system_printf ("size of mount table region changed from %u to %u", + MOUNT_INFO_CB, mount_table->cb); mount_table->init (); /* Initialize the mount table. */ } else if (mount_table->version != MOUNT_VERSION_MAGIC) multiple_cygwin_problem ("mount", mount_table->version, MOUNT_VERSION); + else if (mount_table->cb != MOUNT_INFO_CB) + multiple_cygwin_problem ("mount table size", mount_table->cb, MOUNT_INFO_CB); } |