From: Markus Rietzler Date: Thu, 27 Dec 2012 02:33:32 +0000 (-0700) Subject: Bug 3712: Rotating logs overwrites the previous log X-Git-Tag: SQUID_3_3_0_3~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6bd4356223b0af6281cad93dab0627e17ed2f29;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) {