diff options
Diffstat (limited to 'artd')
-rw-r--r-- | artd/file_utils.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/artd/file_utils.cc b/artd/file_utils.cc index 0ce782a7e9..fb55dec5d5 100644 --- a/artd/file_utils.cc +++ b/artd/file_utils.cc @@ -50,10 +50,9 @@ using ::fmt::literals::operator""_format; // NOLINT void UnlinkIfExists(const std::string& path) { std::error_code ec; - if (!std::filesystem::remove(path, ec)) { - if (ec.value() != ENOENT) { - LOG(WARNING) << "Failed to remove file '{}': {}"_format(path, ec.message()); - } + std::filesystem::remove(path, ec); + if (ec) { + LOG(WARNING) << "Failed to remove file '{}': {}"_format(path, ec.message()); } } |