OSDN Git Service

* fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff.
authorcorinna <corinna>
Tue, 15 Jul 2008 11:42:45 +0000 (11:42 +0000)
committercorinna <corinna>
Tue, 15 Jul 2008 11:42:45 +0000 (11:42 +0000)
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.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_tape.cc
winsup/cygwin/mtinfo.h
winsup/cygwin/shared.cc
winsup/cygwin/shared_info.h

index 69432a4..9a71a93 100644 (file)
@@ -1,3 +1,18 @@
+2008-07-15  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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  <corinna@vinschen.de>
 
        * fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS
index 9b8dca2..593d26c 100644 (file)
@@ -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);
 }
 
 /**********************************************************************/
index ea5a7bb..cccaed8 100644 (file)
@@ -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:
index b2a1b68..047d978 100644 (file)
@@ -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);
index 197ef95..b926bdb 100644 (file)
@@ -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 ();