summaryrefslogtreecommitdiff
path: root/src/login/logind-dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r--src/login/logind-dbus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index d66022f802..1aa6760665 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -344,7 +344,7 @@ static int method_get_session_by_pid(sd_bus_message *message, void *userdata, sd
r = sd_bus_message_read(message, "u", &pid);
if (r < 0)
return r;
- if (pid < 0)
+ if (!pid_is_valid((pid_t) pid))
return -EINVAL;
if (pid == 0) {
@@ -407,7 +407,7 @@ static int method_get_user_by_pid(sd_bus_message *message, void *userdata, sd_bu
r = sd_bus_message_read(message, "u", &pid);
if (r < 0)
return r;
- if (pid < 0)
+ if (!pid_is_valid((pid_t) pid))
return -EINVAL;
if (pid == 0) {