]> 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:33:32 +0000 (19:33 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 27 Dec 2012 02:33:32 +0000 (19:33 -0700)
helpers/log_daemon/file/log_file_daemon.cc

index 5b46c1854cffff23ae1bede5a5259ea58c54b97d..5c365891d3a07c8c146f7333ceb20d29ab8f655b 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) {