Return-Path: Delivered-To: apmail-httpd-bugs-archive@www.apache.org Received: (qmail 4913 invoked from network); 1 Dec 2007 10:27:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Dec 2007 10:27:22 -0000 Received: (qmail 90632 invoked by uid 500); 1 Dec 2007 10:27:09 -0000 Delivered-To: apmail-httpd-bugs-archive@httpd.apache.org Received: (qmail 90589 invoked by uid 500); 1 Dec 2007 10:27:09 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: "Apache HTTPD Bugs Notification List" List-Id: Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 90576 invoked by uid 99); 1 Dec 2007 10:27:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2007 02:27:09 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2007 10:27:20 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 88965714209; Sat, 1 Dec 2007 02:26:54 -0800 (PST) From: bugzilla@apache.org To: bugs@httpd.apache.org Subject: DO NOT REPLY [Bug 44004] New: - rotatelogs patch: reduce apr_time_now(), atomicity, consistency Message-ID: X-Bugzilla-Reason: AssignedTo Date: Sat, 1 Dec 2007 02:26:54 -0800 (PST) X-Virus-Checked: Checked by ClamAV on apache.org DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=44004 Summary: rotatelogs patch: reduce apr_time_now(), atomicity, consistency Product: Apache httpd-2 Version: 2.3-HEAD Platform: All OS/Version: All Status: NEW Keywords: PatchAvailable Severity: enhancement Priority: P2 Component: support AssignedTo: bugs@httpd.apache.org ReportedBy: rainer.jung@kippdata.de While I was looking at rotatelogs.c searching for the reason of the cryptic docs warning about using "-l", I had the idea for slight improvements. I'll attach a small patch, that includes: - when using "-l" reduce two consecutive calls to apr_time_now() to one. This will not change the logic if no "-l" gets used, and it will spare one call to apr_time_now() in case "-l" gets used and more important it gives the code better atomicity, because in fact between the two calls there is a slight change of jumping oder the DST boundary - for historic reasons the same code block is used two times with a slightly different way of transforming apr_time_t to int (once division by APR_USEC_PER_SEC, once call to apr_time_sec()), so let's unify it. - finally move the block into a function, because it gets used already two times. Note that the patch eliminates a side effect, namely in case use_localtime is true the global variable utc_offset could change in main(). We now use utc_offset in main() only for the offset given by the command line flags, which is OK, because either use_localtime is true, or an offset can be given. The attached patch works for trunk (r596796) and the 2.2 branch (r598272), because at the moment both versions of rotatelogs.c are identical (recently backported). -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org