]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3712: Rotating logs overwrites the previous log
authorMarkus Rietzler <markus.rietzler@rzf.fin-nrw.de>
Thu, 27 Dec 2012 02:58:57 +0000 (19:58 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 27 Dec 2012 02:58:57 +0000 (19:58 -0700)
helpers/log_daemon/file/log_file_daemon.cc

index aa946fd9cb3daf35585287b52ae692ff64b1b537..becc3d9326bd06453b5079b7013a9e605a29fc4a 100644 (file)
@@ -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) {