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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97570
13f79535-47bb-0310-9956-
ffa450edef68
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;
}
current_size = finfo.size;
}
- if (current_size > sRotation || nRead < 0) {
+ if (current_size > sRotation) {
nLogFDprev = nLogFD;
nLogFD = NULL;
}
}
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,