[VFS] Fix handling of remove_all return value.

This commit is contained in:
gibbed 2020-11-24 02:01:43 -06:00 committed by Rick Gibbed
parent bda31a443e
commit cabd28b9bb
1 changed files with 2 additions and 1 deletions

View File

@ -100,7 +100,8 @@ bool HostPathEntry::DeleteEntryInternal(Entry* entry) {
std::error_code ec; // avoid exception on remove/remove_all failure std::error_code ec; // avoid exception on remove/remove_all failure
if (entry->attributes() & kFileAttributeDirectory) { if (entry->attributes() & kFileAttributeDirectory) {
// Delete entire directory and contents. // Delete entire directory and contents.
return std::filesystem::remove_all(full_path, ec); auto removed = std::filesystem::remove_all(full_path, ec);
return removed >= 1 && removed != static_cast<std::uintmax_t>(-1);
} else { } else {
// Delete file. // Delete file.
return !std::filesystem::is_directory(full_path) && return !std::filesystem::is_directory(full_path) &&