From: Amos Jeffries Date: Fri, 18 Mar 2016 12:05:14 +0000 (+1300) Subject: Bug 4423: adding stdio: prefix to cache_log directive produces FATAL error X-Git-Tag: SQUID_4_0_8~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98ad5991af30ab07c0ea339458642693ec2f7ab5;p=thirdparty%2Fsquid.git Bug 4423: adding stdio: prefix to cache_log directive produces FATAL error --- diff --git a/src/debug.cc b/src/debug.cc index 2a39a6ad95..1e13e1d617 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -222,7 +222,14 @@ debugOpenLog(const char *logfile) if (debug_log && debug_log != stderr) fclose(debug_log); - debug_log = fopen(logfile, "a+"); + // Bug 4423: ignore the stdio: logging module name if present + const char *logfilename; + if (strncmp(logfile, "stdio:",6) == 0) + logfilename = logfile + 6; + else + logfilename = logfile; + + debug_log = fopen(logfilename, "a+"); if (!debug_log) { fprintf(stderr, "WARNING: Cannot write log file: %s\n", logfile);