]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: provide mkdir() wrapper
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 9 Sep 2013 06:06:59 +0000 (00:06 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 9 Sep 2013 06:06:59 +0000 (00:06 -0600)
compat/os/mswin.h
src/fs/coss/store_dir_coss.cc
src/fs/ufs/UFSSwapDir.cc

index b4748beeec199e90088fb4fea17ac21ddad9a427..7b2081feaf75073f734a962b5f85eec8a5e3140d 100644 (file)
@@ -103,6 +103,9 @@ SQUIDCEXTERN int WIN32_truncate(const char *pathname, off_t length);
 #define mkdir(p,F) _mkdir((p))
 #define mktemp _mktemp
 #endif
+#if _SQUID_MINGW_
+#define mkdir(p,F) mkdir((p))
+#endif
 #define pclose _pclose
 #define pipe WIN32_pipe
 #define popen _popen
index 5b66e4365e004883a06d1ab3c0abc7e70d6aaf99..6dfd98e0af56dae3e5632290497b604b7748946b 100644 (file)
@@ -901,14 +901,7 @@ CossSwapDir::create()
 
     if (::stat(path, &swap_sb) < 0) {
         debugs (47, 2, "COSS swap space space being allocated.");
-#if _SQUID_MSWIN_
-
-        mkdir(path);
-#else
-
         mkdir(path, 0700);
-#endif
-
     }
 
     /* should check here for directories instead of files, and for file size
index 9497fb0783dda189405872aeda59e3a434dce477..99d9011967db3de6520f4b026c375f706cae9092 100644 (file)
@@ -574,14 +574,7 @@ Fs::Ufs::UFSSwapDir::createDirectory(const char *aPath, int should_exist)
         } else {
             fatalf("Swap directory %s is not a directory.", aPath);
         }
-
-#if _SQUID_MSWIN_
-
-    } else if (0 == mkdir(aPath)) {
-#else
-
     } else if (0 == mkdir(aPath, 0755)) {
-#endif
         debugs(47, (should_exist ? DBG_IMPORTANT : 3), aPath << " created");
         created = 1;
     } else {
@@ -1306,14 +1299,7 @@ Fs::Ufs::UFSSwapDir::DirClean(int swap_index)
     if (dir_pointer == NULL) {
         if (errno == ENOENT) {
             debugs(36, DBG_CRITICAL, HERE << "WARNING: Creating " << p1);
-#if _SQUID_MSWIN_
-
-            if (mkdir(p1) == 0)
-#else
-
             if (mkdir(p1, 0777) == 0)
-#endif
-
                 return 0;
         }