From: William A. Rowe Jr Date: Fri, 17 Nov 2000 19:26:15 +0000 (+0000) Subject: Just style nits before someone goes and does something significant. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54e52b09bf086ee88d89b5ae960f0fc12ea97fe5;p=apache Just style nits before someone goes and does something significant. Submitted by: Victor J. Orlikowski [v.j.orlikowski@gte.net] Reviewed by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86996 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/rotatelogs.c b/support/rotatelogs.c index 5f1040e198..f791fcaabc 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -71,10 +71,10 @@ #include #include -#define BUFSIZE 65536 +#define BUFSIZE 65536 #ifndef MAX_PATH -#define MAX_PATH 1024 +#define MAX_PATH 1024 #endif int main (int argc, char *argv[]) @@ -87,59 +87,59 @@ int main (int argc, char *argv[]) char *szLogRoot; if (argc != 3) { - fprintf(stderr, - "%s \n\n", - argv[0]); + fprintf(stderr, + "%s \n\n", + argv[0]); #ifdef OS2 - fprintf(stderr, - "Add this:\n\nTransferLog \"|%s.exe /some/where 86400\"\n\n", - argv[0]); + fprintf(stderr, + "Add this:\n\nTransferLog \"|%s.exe /some/where 86400\"\n\n", + argv[0]); #else - fprintf(stderr, - "Add this:\n\nTransferLog \"|%s /some/where 86400\"\n\n", - argv[0]); + fprintf(stderr, + "Add this:\n\nTransferLog \"|%s /some/where 86400\"\n\n", + argv[0]); #endif - fprintf(stderr, - "to httpd.conf. The generated name will be /some/where.nnnn " - "where nnnn is the\nsystem time at which the log nominally " - "starts (N.B. this time will always be a\nmultiple of the " - "rotation time, so you can synchronize cron scripts with it).\n" - "At the end of each rotation time a new log is started.\n"); - exit(1); + fprintf(stderr, + "to httpd.conf. The generated name will be /some/where.nnnn " + "where nnnn is the\nsystem time at which the log nominally " + "starts (N.B. this time will always be a\nmultiple of the " + "rotation time, so you can synchronize cron scripts with it).\n" + "At the end of each rotation time a new log is started.\n"); + exit(1); } szLogRoot = argv[1]; tRotation = atoi(argv[2]); if (tRotation <= 0) { - fprintf(stderr, "Rotation time must be > 0\n"); - exit(6); + fprintf(stderr, "Rotation time must be > 0\n"); + exit(6); } for (;;) { - nRead = read(0, buf, sizeof buf); - if (nRead == 0) - exit(3); - if (nRead < 0) - if (errno != EINTR) - exit(4); - if (nLogFD >= 0 && (time(NULL) >= tLogEnd || nRead < 0)) { - close(nLogFD); - nLogFD = -1; - } - if (nLogFD < 0) { - time_t tLogStart = (time(NULL) / tRotation) * tRotation; - sprintf(buf2, "%s.%010d", szLogRoot, (int) tLogStart); - tLogEnd = tLogStart + tRotation; - nLogFD = open(buf2, O_WRONLY | O_CREAT | O_APPEND, 0666); - if (nLogFD < 0) { - perror(buf2); - exit(2); - } - } - if (write(nLogFD, buf, nRead) != nRead) { - perror(buf2); - exit(5); - } + nRead = read(0, buf, sizeof buf); + if (nRead == 0) + exit(3); + if (nRead < 0) + if (errno != EINTR) + exit(4); + if (nLogFD >= 0 && (time(NULL) >= tLogEnd || nRead < 0)) { + close(nLogFD); + nLogFD = -1; + } + if (nLogFD < 0) { + time_t tLogStart = (time(NULL) / tRotation) * tRotation; + sprintf(buf2, "%s.%010d", szLogRoot, (int) tLogStart); + tLogEnd = tLogStart + tRotation; + nLogFD = open(buf2, O_WRONLY | O_CREAT | O_APPEND, 0666); + if (nLogFD < 0) { + perror(buf2); + exit(2); + } + } + if (write(nLogFD, buf, nRead) != nRead) { + perror(buf2); + exit(5); + } } /* Of course we never, but prevent compiler warnings */ return 0;