]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fs.c
Make FS_mkdir static, and test for errors.
[xonotic/darkplaces.git] / fs.c
diff --git a/fs.c b/fs.c
index 27381f07cc6bbf2a1ca40da9ab354e737d70934a..e961cd1b5ef3d9fbcb32db0cb267f9de38e5e961 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -893,6 +893,25 @@ static packfile_t* FS_AddFileToPack (const char* name, pack_t* pack,
 }
 
 
+static void FS_mkdir (const char *path)
+{
+       if(COM_CheckParm("-readonly"))
+               return;
+
+#if WIN32
+       if (_mkdir (path) == -1)
+#else
+       if (mkdir (path, 0777) == -1)
+#endif
+       {
+               // No logging for this. The only caller is FS_CreatePath (which
+               // calls it in ways that will intentionally produce EEXIST),
+               // and its own callers always use the directory afterwards and
+               // thus will detect failure that way.
+       }
+}
+
+
 /*
 ============
 FS_CreatePath
@@ -3415,18 +3434,6 @@ qboolean FS_SysFileExists (const char *path)
        return FS_SysFileType (path) != FS_FILETYPE_NONE;
 }
 
-void FS_mkdir (const char *path)
-{
-       if(COM_CheckParm("-readonly"))
-               return;
-
-#if WIN32
-       _mkdir (path);
-#else
-       mkdir (path, 0777);
-#endif
-}
-
 /*
 ===========
 FS_Search