]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Util::unlink_tmp: Log with correct errno (#636)
authorThomas Otto <thomas.otto@pdv-fs.de>
Tue, 25 Aug 2020 20:19:12 +0000 (22:19 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Aug 2020 20:19:12 +0000 (22:19 +0200)
src/Util.cpp

index 7550493206f93d150f20342955d99c1add31160d..ed49fb31e3a68b961884697f9c6f1d7af763e67f 100644 (file)
@@ -1392,6 +1392,7 @@ unlink_tmp(const std::string& path, UnlinkLog unlink_log)
 
   bool success =
     unlink(path.c_str()) == 0 || (errno == ENOENT || errno == ESTALE);
+  saved_errno = errno;
   if (success || unlink_log == UnlinkLog::log_failure) {
     log("Unlink {}", path);
     if (!success) {