From: hno <> Date: Wed, 31 Jan 2001 07:25:59 +0000 (+0000) Subject: Oops.. the coredump_dir patch was incomplete, with quite obvious errors X-Git-Tag: SQUID_3_0_PRE1~1624 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02e8115e95440bd0b1e5de85a9a67ec5c5687f75;p=thirdparty%2Fsquid.git Oops.. the coredump_dir patch was incomplete, with quite obvious errors (did not even compile). Shame on me. --- diff --git a/src/main.cc b/src/main.cc index ac11fd921d..888d47a3db 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.332 2001/01/30 10:06:50 hno Exp $ + * $Id: main.cc,v 1.333 2001/01/31 00:25:59 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -422,17 +422,19 @@ setEffectiveUser(void) static void mainSetCwd(void) { + char *p; if (Config.coredump_dir) { - if (!chdir(Config.coredump_dir)) { + if (chdir(Config.coredump_dir) == 0) { debug(0, 1) ("Set Current Directory to %s\n", Config.coredump_dir); return; } else { debug(50, 0) ("chdir: %s: %s\n", Config.coredump_dir, xstrerror()); } } + /* If we don't have coredump_dir or couldn't cd there, report current dir */ + p = getcwd(NULL, 0); debug(0, 1) ("Current Directory is %s\n", p); xfree(p); - return; } static void