Re: 'nother small tweak - cache_dir chdir'ing

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 30 Jan 2001 11:08:11 +0100

Committed, with the addition of a default specification of coredump_dir
to the default cache location. If commented out or removed then the
current directory will be used.

/Henrik

Kevin Littlejohn wrote:

> So, my revised patch would cut more out:
>
> RCS file: /cvsroot/squid/squid/src/main.c,v
> retrieving revision 1.17
> diff -u -r1.17 main.c
> --- main.c 2001/01/12 08:20:33 1.17
> +++ main.c 2001/01/30 01:49:29
> @@ -430,21 +430,10 @@
> 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?");
> - }
> + /* If we don't have coredump_dir or couldn't cd there, report current dir */
> + char *p = getcwd(NULL, 0);
> + debug(0, 1) ("Current Directory is %s\n", p);
> + xfree(p);
> }
>
> static void
Received on Tue Jan 30 2001 - 03:09:39 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:26 MST