summaryrefslogtreecommitdiff
path: root/Userland/Applications/SpaceAnalyzer
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-03-01 15:55:15 +0000
committerAndreas Kling <kling@serenityos.org>2023-03-05 20:23:42 +0100
commit774f328783db31a02eba76d7c55d53a0b41b1508 (patch)
tree4fc9c393af9d93f2925d38234c9c520bb2e05d75 /Userland/Applications/SpaceAnalyzer
parenta98ae8f35704737e37920b7ddb516ea703a3dca7 (diff)
downloadserenity-774f328783db31a02eba76d7c55d53a0b41b1508.zip
LibCore+Everywhere: Return an Error from DirIterator::error()
This also removes DirIterator::error_string(), since the same strerror() string will be included when you print the Error itself. Except in `ls` which is still using fprintf() for now.
Diffstat (limited to 'Userland/Applications/SpaceAnalyzer')
-rw-r--r--Userland/Applications/SpaceAnalyzer/Tree.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Applications/SpaceAnalyzer/Tree.cpp b/Userland/Applications/SpaceAnalyzer/Tree.cpp
index eb6258a0c0..d77b74c810 100644
--- a/Userland/Applications/SpaceAnalyzer/Tree.cpp
+++ b/Userland/Applications/SpaceAnalyzer/Tree.cpp
@@ -13,7 +13,6 @@
#include <fcntl.h>
#include <sys/stat.h>
-#include <unistd.h>
static constexpr size_t FILES_ENCOUNTERED_UPDATE_STEP_SIZE = 25;
@@ -93,8 +92,9 @@ HashMap<int, int> TreeNode::populate_filesize_tree(Vector<MountInfo>& mounts, Fu
Core::DirIterator dir_iterator(builder.to_deprecated_string(), Core::DirIterator::SkipParentAndBaseDir);
if (dir_iterator.has_error()) {
- int error_sum = error_accumulator.get(dir_iterator.error()).value_or(0);
- error_accumulator.set(dir_iterator.error(), error_sum + 1);
+ auto error_code = dir_iterator.error().code();
+ int error_sum = error_accumulator.get(error_code).value_or(0);
+ error_accumulator.set(error_code, error_sum + 1);
} else {
queue_entry.node->m_children = make<Vector<TreeNode>>();
while (dir_iterator.has_next()) {