Fix a race condition in create_dir().
authorFrancois Gouget <fgouget@codeweavers.com>
Tue, 1 Mar 2005 11:00:06 +0000 (11:00 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 1 Mar 2005 11:00:06 +0000 (11:00 +0000)
server/request.c

index a035e1679c6daa964631d7e5de481713b1c02b77..d7602daa2468a9a28750415dee2ba3bd1e0cf25c 100644 (file)
@@ -509,7 +509,7 @@ static void create_dir( const char *name, struct stat *st )
     if (lstat( name, st ) == -1)
     {
         if (errno != ENOENT) fatal_perror( "lstat %s", name );
-        if (mkdir( name, 0700 ) == -1) fatal_perror( "mkdir %s", name );
+        if (mkdir( name, 0700 ) == -1 && errno != EEXIST) fatal_perror( "mkdir %s", name );
         if (lstat( name, st ) == -1) fatal_perror( "lstat %s", name );
     }
     if (!S_ISDIR(st->st_mode)) fatal_error( "%s is not a directory\n", name );