diff options
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r-- | src/basic/process-util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 056a8b82aa..e4cde6561b 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -475,7 +475,7 @@ static int get_process_id(pid_t pid, const char *field, uid_t *uid) { assert(field); assert(uid); - if (pid < 0) + if (!pid_is_valid(pid)) return -EINVAL; p = procfs_file_alloca(pid, "status"); @@ -788,7 +788,7 @@ int getenv_for_pid(pid_t pid, const char *field, char **_value) { bool pid_is_unwaited(pid_t pid) { /* Checks whether a PID is still valid at all, including a zombie */ - if (pid < 0) + if (!pid_is_valid(pid)) return false; if (pid <= 1) /* If we or PID 1 would be dead and have been waited for, this code would not be running */ @@ -808,7 +808,7 @@ bool pid_is_alive(pid_t pid) { /* Checks whether a PID is still valid and not a zombie */ - if (pid < 0) + if (!pid_is_valid(pid)) return false; if (pid <= 1) /* If we or PID 1 would be a zombie, this code would not be running */ @@ -827,7 +827,7 @@ bool pid_is_alive(pid_t pid) { int pid_from_same_root_fs(pid_t pid) { const char *root; - if (pid < 0) + if (!pid_is_valid(pid)) return false; if (pid == 0 || pid == getpid_cached()) |