From f222f9fdf0a8776d1f9aac38266ec194a1f11711 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 13 Mar 2015 12:24:17 +0000 Subject: [PATCH] Choose "-D" instead of "-d" for the rotatelogs option that creates the path to the log file. I want to use "-d" for another directory related option next where (I think) the "directory" "d" makes more sense. "-d" has not yet been backported, so changing to "-D" is not a real compatibility issue. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1666417 13f79535-47bb-0310-9956-ffa450edef68 --- docs/man/rotatelogs.8 | 2 +- docs/manual/programs/rotatelogs.xml | 2 +- support/rotatelogs.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/man/rotatelogs.8 b/docs/man/rotatelogs.8 index b52ef1a48a..4ee70ea1ce 100644 --- a/docs/man/rotatelogs.8 +++ b/docs/man/rotatelogs.8 @@ -52,7 +52,7 @@ If given, rotatelogs will execute the specified program every time a new log fil -f Causes the logfile to be opened immediately, as soon as rotatelogs starts, instead of waiting for the first logfile entry to be read (for non-busy sites, there may be a substantial delay between when the server is started and when the first request is handled, meaning that the associated logfile does not "exist" until then, which causes problems from some automated logging tools) .TP --d +-D Creates the parent directories of the path that the log file will be placed in if they do not already exist\&. This allows strftime(3) formatting to be used in the path and not just the filename\&. .TP -t diff --git a/docs/manual/programs/rotatelogs.xml b/docs/manual/programs/rotatelogs.xml index d9a2123196..1dbe40cc7a 100644 --- a/docs/manual/programs/rotatelogs.xml +++ b/docs/manual/programs/rotatelogs.xml @@ -85,7 +85,7 @@ and when the first request is handled, meaning that the associated logfile does not "exist" until then, which causes problems from some automated logging tools) -
-d
+
-D
Creates the parent directories of the path that the log file will be placed in if they do not already exist. This allows strftime(3) formatting to be used in the path and not just the filename.
diff --git a/support/rotatelogs.c b/support/rotatelogs.c index 5d936c5c2d..87a26a4d08 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -109,9 +109,9 @@ static void usage(const char *argv0, const char *reason) } fprintf(stderr, #if APR_FILES_AS_SOCKETS - "Usage: %s [-v] [-l] [-L linkname] [-p prog] [-f] [-d] [-t] [-e] [-c] [-n number] " + "Usage: %s [-v] [-l] [-L linkname] [-p prog] [-f] [-D] [-t] [-e] [-c] [-n number] " #else - "Usage: %s [-v] [-l] [-L linkname] [-p prog] [-f] [-d] [-t] [-e] [-n number] " + "Usage: %s [-v] [-l] [-L linkname] [-p prog] [-f] [-D] [-t] [-e] [-n number] " #endif "{|(B|K|M|G)} " "[offset minutes from UTC]\n\n", @@ -143,7 +143,7 @@ static void usage(const char *argv0, const char *reason) " -L path Create hard link from current log to specified path.\n" " -p prog Run specified program after opening a new log file. See below.\n" " -f Force opening of log on program start.\n" - " -d Create parent directories of log file.\n" + " -D Create parent directories of log file.\n" " -t Truncate logfile instead of rotating, tail friendly.\n" " -e Echo log to stdout for further processing.\n" #if APR_FILES_AS_SOCKETS @@ -583,9 +583,9 @@ int main (int argc, const char * const argv[]) apr_pool_create(&status.pool, NULL); apr_getopt_init(&opt, status.pool, argc, argv); #if APR_FILES_AS_SOCKETS - while ((rv = apr_getopt(opt, "lL:p:fdtvecn:", &c, &opt_arg)) == APR_SUCCESS) { + while ((rv = apr_getopt(opt, "lL:p:fDtvecn:", &c, &opt_arg)) == APR_SUCCESS) { #else - while ((rv = apr_getopt(opt, "lL:p:fdtven:", &c, &opt_arg)) == APR_SUCCESS) { + while ((rv = apr_getopt(opt, "lL:p:fDtven:", &c, &opt_arg)) == APR_SUCCESS) { #endif switch (c) { case 'l': @@ -604,7 +604,7 @@ int main (int argc, const char * const argv[]) case 'f': config.force_open = 1; break; - case 'd': + case 'D': config.create_path = 1; break; case 't': -- 2.40.0