From: hno <> Date: Tue, 30 Jan 2001 17:06:48 +0000 (+0000) Subject: Cleanup of coredump_dir. No longer automatically uses the first cache_dir X-Git-Tag: SQUID_3_0_PRE1~1626 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ff76111b95f1e192f101f6ae2625ffb8523c067;p=thirdparty%2Fsquid.git Cleanup of coredump_dir. No longer automatically uses the first cache_dir location, and can be commented out to use the current directory. --- diff --git a/src/cf.data.pre b/src/cf.data.pre index 34f9a2eb2b..463d4e58d9 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/main.cc b/src/main.cc index f958715c2d..ac11fd921d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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