g_mkdir_with_parents: cope with dirs popping into existence
authorMatthias Clasen <mclasen@redhat.com>
Sat, 4 Jun 2011 02:45:51 +0000 (22:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 Jun 2011 02:45:51 +0000 (22:45 -0400)
Don't bail out if a directory suddenly turns out to exist
after all. Proposed in bug 612729.

glib/gfileutils.c

index ec1eddf..c0e95c0 100644 (file)
@@ -102,7 +102,7 @@ g_mkdir_with_parents (const gchar *pathname,
       
       if (!g_file_test (fn, G_FILE_TEST_EXISTS))
        {
-         if (g_mkdir (fn, mode) == -1)
+         if (g_mkdir (fn, mode) == -1 && errno != EEXIST)
            {
              int errno_save = errno;
              g_free (fn);