From e7e739a60e74d067559bab758ba130ca2ebbace7 Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Tue, 3 Oct 2017 12:26:02 +0100 Subject: 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). --- src/login/logind-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/login/logind-core.c') 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 -- cgit v1.2.3