Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 94254 invoked by uid 500); 20 Nov 2002 00:09:57 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 94236 invoked by uid 500); 20 Nov 2002 00:09:57 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 20 Nov 2002 00:09:56 -0000 Message-ID: <20021120000956.4110.qmail@icarus.apache.org> From: trawick@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/support rotatelogs.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N trawick 2002/11/19 16:09:56 Modified: support rotatelogs.c Log: Axe some warnings in rotatelogs which came when the program was converted to use APR. The behaviors of apr_file_read() and apr_file_write() weren't taken completely into account. But note: In a couple of places the check "nRead < 0" was removed. While that is meaningless with APR and hasn't done anything useful in a long time, in Apache 1.3 days it was essentially a check for read-failed-with-EINTR. Apparently a rotation would occur if the read was interrupted by a signal. That function has been lost with the APR-ization. PR: 12617 Revision Changes Path 1.27 +4 -8 httpd-2.0/support/rotatelogs.c Index: rotatelogs.c =================================================================== RCS file: /home/cvs/httpd-2.0/support/rotatelogs.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- rotatelogs.c 14 Jun 2002 17:16:03 -0000 1.26 +++ rotatelogs.c 20 Nov 2002 00:09:56 -0000 1.27 @@ -168,11 +168,9 @@ nRead = sizeof(buf); if (apr_file_read(f_stdin, buf, &nRead) != APR_SUCCESS) exit(3); - if (nRead == 0) - exit(3); if (tRotation) { now = (int)(apr_time_now() / APR_USEC_PER_SEC) + utc_offset; - if (nLogFD != NULL && (now >= tLogEnd || nRead < 0)) { + if (nLogFD != NULL && now >= tLogEnd) { nLogFDprev = nLogFD; nLogFD = NULL; } @@ -186,7 +184,7 @@ current_size = finfo.size; } - if (current_size > sRotation || nRead < 0) { + if (current_size > sRotation) { nLogFDprev = nLogFD; nLogFD = NULL; } @@ -245,10 +243,8 @@ } nMessCount = 0; } - do { - nWrite = nRead; - apr_file_write(nLogFD, buf, &nWrite); - } while (nWrite < 0 && errno == EINTR); + nWrite = nRead; + apr_file_write(nLogFD, buf, &nWrite); if (nWrite != nRead) { nMessCount++; sprintf(errbuf,