httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1490761 - /httpd/httpd/trunk/support/rotatelogs.c
Date Fri, 07 Jun 2013 18:12:17 GMT
Author: covener
Date: Fri Jun  7 18:12:17 2013
New Revision: 1490761

URL: http://svn.apache.org/r1490761
Log:
don't truncate the very first file opened (unless the truncate flag is there too)

Modified:
    httpd/httpd/trunk/support/rotatelogs.c

Modified: httpd/httpd/trunk/support/rotatelogs.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/rotatelogs.c?rev=1490761&r1=1490760&r2=1490761&view=diff
==============================================================================
--- httpd/httpd/trunk/support/rotatelogs.c (original)
+++ httpd/httpd/trunk/support/rotatelogs.c Fri Jun  7 18:12:17 2013
@@ -418,7 +418,7 @@ static void doRotate(rotate_config_t *co
         fprintf(stderr, "Opening file %s\n", newlog.name);
     }
     rv = apr_file_open(&newlog.fd, newlog.name, APR_WRITE | APR_CREATE | APR_APPEND
-                       | (config->truncate || (config->num_files > 0) ? APR_TRUNCATE
: 0), 
+                       | (config->truncate || (config->num_files > 0 &&
status->current.fd) ? APR_TRUNCATE : 0), 
                        APR_OS_DEFAULT, newlog.pool);
     if (rv == APR_SUCCESS) {
         /* Handle post-rotate processing. */



Mime
View raw message