Author: dick
Date: 2007-04-26 10:45:31 -0400 (Thu, 26 Apr 2007)
New Revision: 76325

Modified:
   branches/mono-1-2-4/mono/mono/io-layer/ChangeLog
   branches/mono-1-2-4/mono/mono/io-layer/shared.c
Log:

2007-04-26  Dick Porter  <[EMAIL PROTECTED]>

        * shared.c (_wapi_shm_semaphores_init): Need to check
        MONO_DISABLE_SHM in this entry point, as it's called before
        _wapi_shm_attach().  Fixes bug 81436.




Modified: branches/mono-1-2-4/mono/mono/io-layer/ChangeLog
===================================================================
--- branches/mono-1-2-4/mono/mono/io-layer/ChangeLog    2007-04-26 14:45:27 UTC 
(rev 76324)
+++ branches/mono-1-2-4/mono/mono/io-layer/ChangeLog    2007-04-26 14:45:31 UTC 
(rev 76325)
@@ -1,3 +1,10 @@
+2007-04-26  Dick Porter  <[EMAIL PROTECTED]>
+
+       * shared.c (_wapi_shm_semaphores_init): Need to check
+       MONO_DISABLE_SHM in this entry point, as it's called before
+       _wapi_shm_attach().  Fixes bug 81436.
+
+
 2007-04-13  Dick Porter  <[EMAIL PROTECTED]>
 
        * shared.h:

Modified: branches/mono-1-2-4/mono/mono/io-layer/shared.c
===================================================================
--- branches/mono-1-2-4/mono/mono/io-layer/shared.c     2007-04-26 14:45:27 UTC 
(rev 76324)
+++ branches/mono-1-2-4/mono/mono/io-layer/shared.c     2007-04-26 14:45:31 UTC 
(rev 76325)
@@ -220,6 +220,18 @@
        return(fd);
 }
 
+static gboolean check_disabled (void)
+{
+       if (_wapi_shm_disabled || g_getenv ("MONO_DISABLE_SHM")) {
+               const char* val = g_getenv ("MONO_DISABLE_SHM");
+               if (val == NULL || *val == '1' || *val == 'y' || *val == 'Y') {
+                       _wapi_shm_disabled = TRUE;
+               }
+       }
+
+       return(_wapi_shm_disabled);
+}
+
 /*
  * _wapi_shm_attach:
  * @success: Was it a success
@@ -248,12 +260,8 @@
                return NULL;
        }
 
-       if (_wapi_shm_disabled || g_getenv ("MONO_DISABLE_SHM")) {
-               const char* val = g_getenv ("MONO_DISABLE_SHM");
-               if (val == NULL || *val == '1' || *val == 'y' || *val == 'Y') {
-                       _wapi_shm_disabled = TRUE;
-                       return g_malloc0 (size);
-               }
+       if (check_disabled ()) {
+               return g_malloc0 (size);
        }
 
        fd = _wapi_shm_file_open (filename, size);
@@ -676,7 +684,7 @@
 
 void _wapi_shm_semaphores_init (void)
 {
-       if (_wapi_shm_disabled) {
+       if (check_disabled ()) {
                noshm_semaphores_init ();
        } else {
                shm_semaphores_init ();

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to