]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Save errno to prevent debugs from clobbering it
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 12 Jul 2015 17:42:49 +0000 (19:42 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 12 Jul 2015 17:42:49 +0000 (19:42 +0200)
src/debug.cc

index 5d573a8abb89644c5c7f0b5e7b79a9cc9586dd75..85a03772d41008e579dfa064169ba522ec3df9cc 100644 (file)
@@ -470,7 +470,8 @@ _db_rotate_log(void)
 #endif
         errno = 0;
         if (rename(from, to) == -1) {
-            debugs(0, DBG_IMPORTANT, "log rotation failed: " << xstrerror());
+            const auto saved_errno = errno;
+            debugs(0, DBG_IMPORTANT, "log rotation failed: " << xstrerr(saved_errno));
         }
     }