diff options
author | Eric Covener <covener@apache.org> | 2013-06-07 20:12:17 +0200 |
---|---|---|
committer | Eric Covener <covener@apache.org> | 2013-06-07 20:12:17 +0200 |
commit | 65f9d99f5cee9de8aa6e82974a8a6a91ab76fce2 (patch) | |
tree | f909bb418a9c58cdc89d83f341a146edd71536a6 /support/rotatelogs.c | |
parent | Minor typo fix (diff) | |
download | apache2-65f9d99f5cee9de8aa6e82974a8a6a91ab76fce2.tar.xz apache2-65f9d99f5cee9de8aa6e82974a8a6a91ab76fce2.zip |
don't truncate the very first file opened (unless the truncate flag is there too)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1490761 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/rotatelogs.c')
-rw-r--r-- | support/rotatelogs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/support/rotatelogs.c b/support/rotatelogs.c index 52a59e030d..cf1eac1ea8 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -418,7 +418,7 @@ static void doRotate(rotate_config_t *config, rotate_status_t *status) fprintf(stderr, "Opening file %s\n", newlog.name); } rv = apr_file_open(&newlog.fd, newlog.name, APR_WRITE | APR_CREATE | APR_APPEND - | (config->truncate || (config->num_files > 0) ? APR_TRUNCATE : 0), + | (config->truncate || (config->num_files > 0 && status->current.fd) ? APR_TRUNCATE : 0), APR_OS_DEFAULT, newlog.pool); if (rv == APR_SUCCESS) { /* Handle post-rotate processing. */ |