]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
pathnames
authorwessels <>
Fri, 25 Apr 1997 23:02:18 +0000 (23:02 +0000)
committerwessels <>
Fri, 25 Apr 1997 23:02:18 +0000 (23:02 +0000)
src/store_dir.cc

index e2ba58b52175908a7c594b368b02885f1ce2d28e..7ea8120070312ca3b1955790c081da3202398ef5 100644 (file)
@@ -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);