From: wessels <> Date: Fri, 25 Apr 1997 23:02:18 +0000 (+0000) Subject: pathnames X-Git-Tag: SQUID_3_0_PRE1~5055 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc35a8d131257beb72307b1fbc586f4a64b41a5e;p=thirdparty%2Fsquid.git pathnames --- diff --git a/src/store_dir.cc b/src/store_dir.cc index e2ba58b521..7ea8120070 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -85,7 +85,7 @@ storeVerifyOrCreateDir(const char *path) struct stat sb; if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) return 0; - safeunlink(path, 0); + safeunlink(path, 1); if (mkdir(path, 0777) < 0) { if (errno != EEXIST) { sprintf(tmp_error_buf, "Failed to create swap directory %s: %s", @@ -95,7 +95,7 @@ storeVerifyOrCreateDir(const char *path) } } debug(20, 1, "Created directory %s\n", path); - if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode) != 0) { + if (stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) { sprintf(tmp_error_buf, "Failed to create directory %s: %s", path, xstrerror()); fatal(tmp_error_buf);