* Makefile.in: Autogenerate some header files which provide magic numbers.
Force dependencies for files which depend on autogenerated headers to ensure that they are always built. * child_info.h (child_info): Add new fields to accommodate new magic number header stuff. * dcrt0.cc: Rely on "child_info_magic.h" to ensure that correct child_info magic numbers are used. (dll_crt0_1): Temporarily remove _cygwin_testing_magic test. (_dll_crt0): Do more testing on magic numbers from fork_info structure. Call "multiple_cygwin_problem" where appropriate. (multiple_cygwin_problem): Rename from multiple_cygwin_die. Issue a warning or die, as appropriate based on cygwin version/magic number mismatch. * pinfo.cc (pinfo::exit): Don't attempt to dereference `this' if it doesn't exist. This can happen when a fatal error occurs early in process initialization. * shared.cc: Rely on "shared_info_magic.h" to accommodate that new magic number header stuff. (shared_info::initialize): Use new magic number stuff, for shared region. (memory_init): Ditto, for mount table. * shared_info.h: Accomodate new magic number stuff for shared region and mount table. * sigproc.cc: Rely on "child_info_magic.h" to accommodate new magic number header stuff. (init_child_info): Initialize new fields in child_info) to accomodate magic numbers. * winsup.h: Rename multiple_cygwin_die to multiple_cygwin_problem. * include/cygwin/version.h: Define macros for manipulating version magic. * cygmagic: New shell script for generating magic numbers.
This commit is contained in:
@@ -25,13 +25,10 @@ details. */
|
||||
#include "cygerrno.h"
|
||||
#include "cygheap.h"
|
||||
#include "heap.h"
|
||||
#include "shared_info.h"
|
||||
#include "shared_info_magic.h"
|
||||
#include "registry.h"
|
||||
#include "cygwin_version.h"
|
||||
|
||||
#define SHAREDVER (unsigned)(cygwin_version.api_major << 16 | \
|
||||
cygwin_version.api_minor)
|
||||
|
||||
shared_info NO_COPY *cygwin_shared = NULL;
|
||||
mount_info NO_COPY *mount_table = NULL;
|
||||
HANDLE cygwin_mount_h;
|
||||
@@ -108,8 +105,8 @@ shared_info::initialize ()
|
||||
{
|
||||
if (inited)
|
||||
{
|
||||
if (inited != SHAREDVER)
|
||||
multiple_cygwin_die ();
|
||||
if (inited != SHARED_VERSION_MAGIC)
|
||||
multiple_cygwin_problem ("shared", inited, SHARED_VERSION);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,7 +115,7 @@ shared_info::initialize ()
|
||||
|
||||
/* Initialize tty table. */
|
||||
tty.init ();
|
||||
inited = SHAREDVER;
|
||||
inited = SHARED_VERSION_MAGIC;
|
||||
}
|
||||
|
||||
void __stdcall
|
||||
@@ -163,12 +160,12 @@ memory_init ()
|
||||
/* Initialize the Cygwin per-user mount table, if necessary */
|
||||
if (!mount_table->version)
|
||||
{
|
||||
mount_table->version = MOUNT_VERSION;
|
||||
mount_table->version = MOUNT_VERSION_MAGIC;
|
||||
debug_printf ("initializing mount table");
|
||||
mount_table->init (); /* Initialize the mount table. */
|
||||
}
|
||||
else if (mount_table->version != MOUNT_VERSION)
|
||||
multiple_cygwin_die ();
|
||||
else if (mount_table->version != MOUNT_VERSION_MAGIC)
|
||||
multiple_cygwin_problem ("mount", mount_table->version, MOUNT_VERSION);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user