]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup of coredump_dir. No longer automatically uses the first cache_dir
authorhno <>
Tue, 30 Jan 2001 17:06:48 +0000 (17:06 +0000)
committerhno <>
Tue, 30 Jan 2001 17:06:48 +0000 (17:06 +0000)
location, and can be commented out to use the current directory.

src/cf.data.pre
src/main.cc

index 34f9a2eb2bc665471dcd49d3aa8e2990282db323..463d4e58d9ce77d05edaec4e7be740892e730355 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.209 2001/01/28 00:45:45 hno Exp $
+# $Id: cf.data.pre,v 1.210 2001/01/30 10:06:48 hno Exp $
 #
 #
 # SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -3237,11 +3237,17 @@ NAME: coredump_dir
 TYPE: string
 LOC: Config.coredump_dir
 DEFAULT: none
+DEFAULT_IF_NONE: none
 DOC_START
-       By default Squid leaves core files in the first cache_dir
-       directory.  If you set 'coredump_dir' to a directory
+       By default Squid leaves core files in the directory from where
+       it was started. If you set 'coredump_dir' to a directory
        that exists, Squid will chdir() to that directory at startup
        and coredump files will be left there.
+
+NOCOMMENT_START
+# Leave coredumps in the first cache dir
+coredump_dir @DEFAULT_SWAP_DIR@
+NOCOMMENT_END
 DOC_END
 
 NAME: redirector_bypass
index f958715c2d7c515bec12cb25ed250ac0ee62b4e4..ac11fd921d10ea90c186bfa62f3dcb71fef65d08 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.331 2001/01/12 00:37:19 wessels Exp $
+ * $Id: main.cc,v 1.332 2001/01/30 10:06:50 hno Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -430,21 +430,9 @@ mainSetCwd(void)
            debug(50, 0) ("chdir: %s: %s\n", Config.coredump_dir, xstrerror());
        }
     }
-    if (!Config.effectiveUser) {
-       char *p = getcwd(NULL, 0);
-       debug(0, 1) ("Current Directory is %s\n", p);
-       xfree(p);
-       return;
-    }
-    /* we were probably started as root, so cd to a swap
-     * directory in case we dump core */
-    if (!chdir(storeSwapDir(0))) {
-       debug(0, 1) ("Set Current Directory to %s\n", storeSwapDir(0));
-       return;
-    } else {
-       debug(50, 0) ("%s: %s\n", storeSwapDir(0), xstrerror());
-       fatal_dump("Cannot cd to swap directory?");
-    }
+    debug(0, 1) ("Current Directory is %s\n", p);
+    xfree(p);
+    return;
 }
 
 static void