From d6cb8ec8e34bf34fa77a97fcb15c49063c038ab3 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 13 Mar 2015 12:15:40 +0000 Subject: [PATCH] Small changes to rotatelogs: - add "-n num" to help text - clarify in help text, that "program is invoked" is the "-p" case - prevent crash with "-v" (verbose) if no "-p prog" is used - add one space for formatting git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1666415 13f79535-47bb-0310-9956-ffa450edef68 --- support/rotatelogs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/support/rotatelogs.c b/support/rotatelogs.c index 83707d5dec..5d936c5c2d 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -149,8 +149,9 @@ static void usage(const char *argv0, const char *reason) #if APR_FILES_AS_SOCKETS " -c Create log even if it is empty.\n" #endif + " -n num Rotate file by adding suffixes '.0', '.1', ..., '.(num-1)'.\n" "\n" - "The program is invoked as \"[prog] []\"\n" + "The program for '-p' is invoked as \"[prog] []\"\n" "where is the filename of the newly opened logfile, and\n" ", if given, is the filename of the previously used logfile.\n" "\n"); @@ -213,7 +214,7 @@ static void dumpConfig (rotate_config_t *config) fprintf(stderr, "Rotation create empty logs: %12s\n", config->create_empty ? "yes" : "no"); #endif fprintf(stderr, "Rotation file name: %21s\n", config->szLogRoot); - fprintf(stderr, "Post-rotation prog: %21s\n", config->postrotate_prog); + fprintf(stderr, "Post-rotation prog: %21s\n", config->postrotate_prog ? config->postrotate_prog : "not used"); } /* @@ -280,7 +281,7 @@ static void post_rotate(apr_pool_t *pool, struct logfile *newlog, if (config->linkfile) { apr_file_remove(config->linkfile, newlog->pool); if (config->verbose) { - fprintf(stderr,"Linking %s to %s\n", newlog->name, config->linkfile); + fprintf(stderr, "Linking %s to %s\n", newlog->name, config->linkfile); } rv = apr_file_link(newlog->name, config->linkfile); if (rv != APR_SUCCESS) { -- 2.40.0