tree-wide: use pid_is_valid() at more places

This commit is contained in:
Lennart Poettering
2017-08-31 15:45:04 +02:00
parent 702b64846e
commit ee043777be
5 changed files with 12 additions and 10 deletions
+4 -2
View File
@@ -3348,8 +3348,10 @@ static int logind_check_inhibitors(enum action a) {
if (!sv)
return log_oom();
if ((pid_t) pid < 0)
return log_error_errno(ERANGE, "Bad PID %"PRIu32": %m", pid);
if (!pid_is_valid((pid_t) pid)) {
log_error("Invalid PID %" PRIu32 ".", pid);
return -ERANGE;
}
if (!strv_contains(sv,
IN_SET(a,