--------------------- PatchSet 4555 Date: 2007/05/15 15:27:53 Author: adri Branch: squid3_logdaemon Tag: (none) Log: Document error semantics for me to look at later. Members: src/LogFileBlocking.cc:1.1.2.3->1.1.2.4 Index: squid3/src/LogFileBlocking.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/LogFileBlocking.cc,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid3/src/LogFileBlocking.cc 15 May 2007 14:32:43 -0000 1.1.2.3 +++ squid3/src/LogFileBlocking.cc 15 May 2007 15:27:53 -0000 1.1.2.4 @@ -1,5 +1,5 @@ /* - * $Id: LogFileBlocking.cc,v 1.1.2.3 2007/05/15 14:32:43 adri Exp $ + * $Id: LogFileBlocking.cc,v 1.1.2.4 2007/05/15 15:27:53 adri Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Adrian Chadd @@ -62,6 +62,11 @@ fclose(fp); fp = NULL; } + +/* + * For fun, convert this routine over to use temporary C strings rather than + * the C buffers and snprintf.. -adrian + */ void LogFileBlocking::Rotate(void) { @@ -80,7 +85,6 @@ return; #endif - debugs(0, 1, "LogFileBlocking::Rotate: " << logpath); /* Rotate numbers 0 through N up one */ @@ -100,6 +104,14 @@ } /* Reopen the log. It may have been renamed "manually" */ + /* + * The semantics here suck - fp will be NULL on error and not fatal here, but + * subsequent operations on this instance will fail the assert(fp != NULL) in + * places. The semantics weren't all that clear about how to treat a failure + * at this point; and I'm tempted to suggest we just flag the thing as + * broken and sink IO to it until the next rotate/reload reopens the logfiles. + * -adrian + */ fp = fopen(logpath.c_str(), "a"); if (fp == NULL && do_fatal) {