2009-05-26 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 26 May 2009 21:09:23 +0000 (21:09 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 26 May 2009 21:09:23 +0000 (21:09 -0000)
* shared.c (_wapi_shm_file): Avoid creating a .wapi directory here, create
it in _wapi_shm_file_open (), since platforms using posix shm don't need it.

svn path=/trunk/mono/; revision=134798

mono/io-layer/ChangeLog
mono/io-layer/shared.c

index e17c10120e24dbbca633deee5443057731b43ca6..d2a7751075f59499805d481ca913d4d69357c308 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-26  Zoltan Varga  <vargaz@gmail.com>
+
+       * shared.c (_wapi_shm_file): Avoid creating a .wapi directory here, create
+       it in _wapi_shm_file_open (), since platforms using posix shm don't need it.
+
 2009-05-22  Miguel de Icaza  <miguel@novell.com>
 
        * wapi_glob.c: Do not need sys/param.h anymore, we now use the
index 467caf5e9ffebccb0e67b752353cb6e41b591aa8..0759daf11fead4ed83e597af8e2d9a1ad6be8599 100644 (file)
@@ -240,7 +240,7 @@ static gchar *
 _wapi_shm_file (_wapi_shm_t type)
 {
        static gchar file[_POSIX_PATH_MAX];
-       gchar *name = NULL, *filename, *dir, *wapi_dir;
+       gchar *name = NULL, *filename, *wapi_dir;
 
        name = _wapi_shm_base_name (type);
 
@@ -259,14 +259,6 @@ _wapi_shm_file (_wapi_shm_t type)
 
        g_snprintf (file, _POSIX_PATH_MAX, "%s", filename);
        g_free (filename);
-               
-       /* No need to check if the dir already exists or check
-        * mkdir() errors, because on any error the open() call will
-        * report the problem.
-        */
-       dir = g_path_get_dirname (file);
-       mkdir (dir, 0755);
-       g_free (dir);
        
        return file;
 }
@@ -279,6 +271,15 @@ _wapi_shm_file_open (const gchar *filename, guint32 wanted_size)
        int ret, tries = 0;
        gboolean created = FALSE;
        mode_t oldmask;
+       gchar *dir;
+               
+       /* No need to check if the dir already exists or check
+        * mkdir() errors, because on any error the open() call will
+        * report the problem.
+        */
+       dir = g_path_get_dirname (filename);
+       mkdir (dir, 0755);
+       g_free (dir);
 
 try_again:
        if (tries++ > 10) {