summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorFabian Dellwing <fabian.dellwing@gmail.com>2023-05-01 20:27:49 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-07 11:55:58 +0200
commit589d2d50f5897e90f5e8dd228ea3aaf5c8367576 (patch)
tree3ec5e367d0f5b1fb23a3154bb3f76fce4958d184 /Userland
parent2cd59df4430d14618727b407136ec44a02af400a (diff)
downloadserenity-589d2d50f5897e90f5e8dd228ea3aaf5c8367576.zip
netstat: Fix fallback value for pid field
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Utilities/netstat.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Utilities/netstat.cpp b/Userland/Utilities/netstat.cpp
index 71427757a5..93c90adf09 100644
--- a/Userland/Utilities/netstat.cpp
+++ b/Userland/Utilities/netstat.cpp
@@ -231,7 +231,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto state = if_object.get_deprecated_string("state"sv).value_or({});
auto origin_uid = if_object.get_i32("origin_uid"sv).value_or(-1);
- auto origin_pid = (if_object.has("origin_pid"sv)) ? if_object.get_u32("origin_pid"sv).value_or(0) : -1;
+ auto origin_pid = if_object.get_i32("origin_pid"sv).value_or(-1);
if (!flag_all && ((state == "Listen" && !flag_list) || (state != "Listen" && flag_list)))
continue;
@@ -316,7 +316,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
}
- auto origin_pid = (if_object.has("origin_pid"sv)) ? if_object.get_u32("origin_pid"sv).value_or(0) : -1;
+ auto origin_pid = if_object.get_i32("origin_pid"sv).value_or(-1);
auto origin_uid = if_object.get_i32("origin_uid"sv).value_or(-1);
if (protocol_column != -1)