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

Modified:
   trunk/mono/mono/io-layer/ChangeLog
   trunk/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: trunk/mono/mono/io-layer/ChangeLog
===================================================================
--- trunk/mono/mono/io-layer/ChangeLog  2007-04-26 14:24:04 UTC (rev 76323)
+++ trunk/mono/mono/io-layer/ChangeLog  2007-04-26 14:45:27 UTC (rev 76324)
@@ -1,3 +1,9 @@
+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-24  Dick Porter  <[EMAIL PROTECTED]>
 
        * sockets.c (_wapi_recvfrom, socket_close): Force recvfrom() to

Modified: trunk/mono/mono/io-layer/shared.c
===================================================================
--- trunk/mono/mono/io-layer/shared.c   2007-04-26 14:24:04 UTC (rev 76323)
+++ trunk/mono/mono/io-layer/shared.c   2007-04-26 14:45:27 UTC (rev 76324)
@@ -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