summaryrefslogtreecommitdiff
path: root/src/login/logind-core.c
diff options
context:
space:
mode:
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>2017-10-03 12:26:02 +0100
committerSven Eden <yamakuzure@gmx.net>2017-12-08 07:27:39 +0100
commite7e739a60e74d067559bab758ba130ca2ebbace7 (patch)
treea226499f88afb98492512016b7d0af12d52d31ee /src/login/logind-core.c
parent5b65a773c10cdab7e9f36312dd4f7cabea3d9bf5 (diff)
logind: use pid_is_valid() where appropriate
These two sites _do_ match the definition of pid_is_valid(); they don't provide any special handling for the invalid PID value 0. (They're used by dbus methods, so the PID value 0 is handled with reference to the dbus client creds, outside of these functions).
Diffstat (limited to 'src/login/logind-core.c')
-rw-r--r--src/login/logind-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index 714503228..95e2363dd 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -291,7 +291,7 @@ int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session) {
assert(m);
- if (pid < 1)
+ if (!pid_is_valid(pid))
return -EINVAL;
#if 0 /// elogind does not support systemd units, but its own session system
@@ -330,7 +330,7 @@ int manager_get_user_by_pid(Manager *m, pid_t pid, User **user) {
assert(m);
assert(user);
- if (pid < 1)
+ if (!pid_is_valid(pid))
return -EINVAL;
#if 0 /// elogind does not support systemd units, but its own session system