From: Markus Rietzler Date: Mon, 10 Dec 2012 12:05:29 +0000 (-0700) Subject: Bug 3712: Rotating logs overwrites the previous log X-Git-Tag: SQUID_3_4_0_1~451 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25f563833326aeffe0e6fb77e439eea6017dcf2b;p=thirdparty%2Fsquid.git Bug 3712: Rotating logs overwrites the previous log --- diff --git a/helpers/log_daemon/file/log_file_daemon.cc b/helpers/log_daemon/file/log_file_daemon.cc index 5b46c1854c..5c365891d3 100644 --- a/helpers/log_daemon/file/log_file_daemon.cc +++ b/helpers/log_daemon/file/log_file_daemon.cc @@ -61,8 +61,8 @@ rotate(const char *path, int rotate_count) fprintf(stderr, "WARNING: remove '%s' failure: %s\n", to, xstrerror()); } #endif - if (rename(path, to) < 0 && errno != ENOENT) { - fprintf(stderr, "WARNING: rename '%s' to '%s' failure: %s\n", path, to, xstrerror()); + if (rename(from, to) < 0 && errno != ENOENT) { + fprintf(stderr, "WARNING: rename '%s' to '%s' failure: %s\n", from, to, xstrerror()); } } if (rotate_count > 0) {