]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Oops.. the coredump_dir patch was incomplete, with quite obvious errors
authorhno <>
Wed, 31 Jan 2001 07:25:59 +0000 (07:25 +0000)
committerhno <>
Wed, 31 Jan 2001 07:25:59 +0000 (07:25 +0000)
(did not even compile). Shame on me.

src/main.cc

index ac11fd921d10ea90c186bfa62f3dcb71fef65d08..888d47a3dba4574a3e7e57a6f1227f8c42ec8da3 100644 (file)
@@ -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