diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 69432a442..9a71a93dd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,18 @@ +2008-07-15 Corinna Vinschen + + * fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff. + Just initialize drive data. + * mtinfo.h (MTINFO_MAGIC): Remove. + (MTINFO_VERSION): Remove. + (class mtinfo): Remove magic and version members. + * shared.cc (shared_info::initialize): Move call to + get_session_parent_dir so that the dir creation is only called once. + Move call to mt.initialize so that it's called only by the first + process creating the shared memory. + * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Add obcaseinsensitivity member. + 2008-07-14 Corinna Vinschen * fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index 9b8dca220..593d26cf0 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -1,7 +1,8 @@ /* fhandler_tape.cc. See fhandler.h for a description of the fhandler classes. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008 Red Hat, Inc. This file is part of Cygwin. @@ -1125,33 +1126,8 @@ mtinfo_drive::ioctl (HANDLE mt, unsigned int cmd, void *buf) void mtinfo::initialize () { - char name[MAX_PATH]; - HANDLE mtx; - - shared_name (name, "mtinfo_mutex", 0); - if (!(mtx = CreateMutex (&sec_all_nih, FALSE, name))) - api_fatal ("CreateMutex '%s', %E. Terminating.", name); - WaitForSingleObject (mtx, INFINITE); - if (!magic) - { - magic = MTINFO_MAGIC; - version = MTINFO_VERSION; - for (unsigned i = 0; i < MAX_DRIVE_NUM; ++i) - drive (i)->initialize (i, true); - ReleaseMutex (mtx); - CloseHandle (mtx); - } - else - { - ReleaseMutex (mtx); - CloseHandle (mtx); - if (magic != MTINFO_MAGIC) - api_fatal ("MT magic number screwed up: %lu, should be %lu", - magic, MTINFO_MAGIC); - if (version != MTINFO_VERSION) - system_printf ("MT version number mismatch: %lu, should be %lu", - version, MTINFO_VERSION); - } + for (unsigned i = 0; i < MAX_DRIVE_NUM; ++i) + drive (i)->initialize (i, true); } /**********************************************************************/ diff --git a/winsup/cygwin/mtinfo.h b/winsup/cygwin/mtinfo.h index ea5a7bb43..cccaed8b7 100644 --- a/winsup/cygwin/mtinfo.h +++ b/winsup/cygwin/mtinfo.h @@ -1,6 +1,6 @@ /* mtinfo.h: Defininitions for the Cygwin tape driver class. - Copyright 2004, 2005, 2006 Red Hat, Inc. + Copyright 2004, 2005, 2006, 2008 Red Hat, Inc. This file is part of Cygwin. @@ -8,9 +8,6 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#define MTINFO_MAGIC 0x179b2af0 -#define MTINFO_VERSION 2 - /* Maximum number of supported partitions per drive. */ #define MAX_PARTITION_NUM 64 /* Maximum number of supported drives. */ @@ -132,8 +129,6 @@ public: class mtinfo { - DWORD magic; - DWORD version; mtinfo_drive _drive[MAX_DRIVE_NUM]; public: diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index b2a1b68a5..047d97895 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -256,17 +256,15 @@ shared_info::initialize () } heap_init (); + get_session_parent_dir (); /* Create session dir if first process. */ if (!sversion) { tty.init (); /* Initialize tty table. */ + mt.initialize (); /* Initialize shared tape information. */ cb = sizeof (*this); /* Do last, after all shared memory initialization */ } - mt.initialize (); /* Initialize shared tape information. */ - - get_session_parent_dir (); /* Create session dir if first process. */ - if (cb != SHARED_INFO_CB) system_printf ("size of shared memory region changed from %u to %u", SHARED_INFO_CB, cb); diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h index 197ef9529..b926bdb1e 100644 --- a/winsup/cygwin/shared_info.h +++ b/winsup/cygwin/shared_info.h @@ -118,9 +118,9 @@ public: cygwin_version.api_minor) #define SHARED_VERSION_MAGIC CYGWIN_VERSION_MAGIC (SHARED_MAGIC, SHARED_VERSION) -#define SHARED_INFO_CB 31144 +#define SHARED_INFO_CB 31136 -#define CURR_SHARED_MAGIC 0xbc77afb0U +#define CURR_SHARED_MAGIC 0xace17c0fU /* NOTE: Do not make gratuitous changes to the names or organization of the below class. The layout is checksummed to determine compatibility between @@ -136,6 +136,7 @@ class shared_info DWORD sys_mount_table_counter; tty_list tty; LONG last_used_bindresvport; + DWORD obcaseinsensitivity; mtinfo mt; void initialize ();