From: Amos Jeffries Date: Mon, 8 Oct 2012 05:35:27 +0000 (-0600) Subject: Windows: provide mkdir() wrapper X-Git-Tag: SQUID_3_4_0_1~603 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68633b963d139ea9856196c4900d3587424c75f1;p=thirdparty%2Fsquid.git Windows: provide mkdir() wrapper --- diff --git a/compat/os/mswin.h b/compat/os/mswin.h index 2ab93405ae..c23c4d9e3d 100644 --- a/compat/os/mswin.h +++ b/compat/os/mswin.h @@ -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 diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index f9e55812ed..6dfd98e0af 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -901,14 +901,7 @@ CossSwapDir::create() if (::stat(path, &swap_sb) < 0) { debugs (47, 2, "COSS swap space space being allocated."); -#if _SQUID_WINDOWS_ - - mkdir(path); -#else - mkdir(path, 0700); -#endif - } /* should check here for directories instead of files, and for file size diff --git a/src/fs/ufs/UFSSwapDir.cc b/src/fs/ufs/UFSSwapDir.cc index 7560be48d4..4ae01d192f 100644 --- a/src/fs/ufs/UFSSwapDir.cc +++ b/src/fs/ufs/UFSSwapDir.cc @@ -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_WINDOWS_ - - } 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 { @@ -1307,14 +1300,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_WINDOWS_ - - if (mkdir(p1) == 0) -#else - if (mkdir(p1, 0777) == 0) -#endif - return 0; }