mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 10:25:37 +03:00
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).
This commit is contained in:
parent
72b3f82e17
commit
6f876815c6
@ -287,7 +287,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;
|
||||
|
||||
r = cg_pid_get_unit(pid, &unit);
|
||||
@ -311,7 +311,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;
|
||||
|
||||
r = cg_pid_get_slice(pid, &unit);
|
||||
|
Loading…
Reference in New Issue
Block a user