summaryrefslogtreecommitdiffstats
path: root/src/login
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-08-31 10:25:06 +0200
committerLennart Poettering <lennart@poettering.net>2017-08-31 15:45:04 +0200
commitee043777be58251e7441b4f04594e9e3792d7fb2 (patch)
tree7f9be35e5c483853e5feab9e914a3099d322ea32 /src/login
parentMerge pull request #6704 from andir/fix_vrf_table_identifier (diff)
downloadsystemd-ee043777be58251e7441b4f04594e9e3792d7fb2.tar.xz
systemd-ee043777be58251e7441b4f04594e9e3792d7fb2.zip
tree-wide: use pid_is_valid() at more places
Diffstat (limited to 'src/login')
-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) {