summaryrefslogtreecommitdiff
path: root/Userland/Utilities/w.cpp
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-12-08 14:50:31 +0100
committerLinus Groh <mail@linusgroh.de>2022-12-10 11:49:24 +0000
commit8940f2da7fec4b4e375777c861e65ff04465f255 (patch)
treed1ac58cae77af94ea378a93fb818e8787faed542 /Userland/Utilities/w.cpp
parente338a0656dd8e99e9ed64abf98d15e219adb9755 (diff)
downloadserenity-8940f2da7fec4b4e375777c861e65ff04465f255.zip
LibCore: Use `Core::Stream` for `ProcessStatisticsReader`
Diffstat (limited to 'Userland/Utilities/w.cpp')
-rw-r--r--Userland/Utilities/w.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Utilities/w.cpp b/Userland/Utilities/w.cpp
index 1c905dae80..5e3f0a7dc9 100644
--- a/Userland/Utilities/w.cpp
+++ b/Userland/Utilities/w.cpp
@@ -33,11 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
return 1;
}
- auto process_statistics = Core::ProcessStatisticsReader::get_all();
- if (!process_statistics.has_value()) {
- warnln("Error: Could not get process statistics");
- return 1;
- }
+ auto process_statistics = TRY(Core::ProcessStatisticsReader::get_all());
auto now = time(nullptr);
@@ -70,7 +66,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
DeprecatedString what = "n/a";
- for (auto& process : process_statistics.value().processes) {
+ for (auto& process : process_statistics.processes) {
if (process.tty == tty && process.pid == process.pgid)
what = process.name;
}