]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: provide POSIX ABI wrapper for mkdir()
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 8 Aug 2012 07:21:13 +0000 (19:21 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 8 Aug 2012 07:21:13 +0000 (19:21 +1200)
compat/os/mswin.h
src/fs/coss/store_dir_coss.cc
src/fs/ufs/store_dir_ufs.cc
src/ssl/certificate_db.cc

index 45bcf4bcb211f1dd7ea54988c074ddf66490880d..6561b41f94ee0f6bba2cdcbb4d0522038c80d8bc 100644 (file)
@@ -97,7 +97,7 @@ typedef unsigned long ino_t;
 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
 #define lseek _lseeki64
 #define memccpy _memccpy
-#define mkdir(p) _mkdir(p)
+#define mkdir(p,F) _mkdir((p))
 #define mktemp _mktemp
 #endif
 #define pclose _pclose
index ffd78f74da8472ac9603c3138a3b8d4615c6b458..b4bd61e7321e7c6cf5fdfe6b73efc4c5e7428fc0 100644 (file)
@@ -899,14 +899,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 ef183af47105350d9ba5c1add6947f1454f4ad74..9c6fa87822fa83c4ed5f2547c6723f16fee0d21f 100644 (file)
@@ -509,14 +509,7 @@ 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 ? 1 : 3), aPath << " created");
         created = 1;
     } else {
@@ -1117,14 +1110,7 @@ UFSSwapDir::DirClean(int swap_index)
     if (dir_pointer == NULL) {
         if (errno == ENOENT) {
             debugs(36, 0, "storeDirClean: WARNING: Creating " << p1);
-#if _SQUID_MSWIN_
-
-            if (mkdir(p1) == 0)
-#else
-
             if (mkdir(p1, 0777) == 0)
-#endif
-
                 return 0;
         }
 
index 86eafffb46017987d2951038ea7eb86a996fa36c..3f8069aa07b56296212251c87cfaea1a74f93c35 100644 (file)
@@ -286,18 +286,10 @@ void Ssl::CertificateDb::create(std::string const & db_path)
     std::string cert_full(db_path + "/" + cert_dir);
     std::string size_full(db_path + "/" + size_file);
 
-#if _SQUID_MSWIN_
-    if (mkdir(db_path.c_str()))
-#else
     if (mkdir(db_path.c_str(), 0777))
-#endif
         throw std::runtime_error("Cannot create " + db_path);
 
-#if _SQUID_MSWIN_
-    if (mkdir(cert_full.c_str()))
-#else
     if (mkdir(cert_full.c_str(), 0777))
-#endif
         throw std::runtime_error("Cannot create " + cert_full);
 
     std::ofstream size(size_full.c_str());