We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1e2a1f2 + b328d3b commit 0908fd5Copy full SHA for 0908fd5
1 file changed
src/node-persistent-cache.cpp
@@ -7,11 +7,13 @@
7
* For a full list of authors see the git log.
8
*/
9
10
-#include "logging.hpp"
11
#include "node-persistent-cache.hpp"
12
+#include "logging.hpp"
13
+
14
#include <cassert>
15
#include <cerrno>
16
+#include <filesystem>
17
#include <system_error>
18
#include <utility>
19
@@ -55,9 +57,14 @@ node_persistent_cache::~node_persistent_cache() noexcept
55
57
if (m_remove_file) {
56
58
try {
59
log_debug("Removing persistent node cache at '{}'.", m_file_name);
60
+ std::error_code ec{};
61
+ std::filesystem::remove(m_file_name, ec);
62
+ if (ec) {
63
+ log_warn("Failed to remove persistent node cache at '{}': {}.",
64
+ m_file_name, ec.message());
65
+ }
66
} catch (...) {
67
// exception ignored on purpose
68
}
- unlink(m_file_name.c_str());
69
70
0 commit comments