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