assert(field);
assert(uid);
- if (pid < 0)
+ if (!pid_is_valid(pid))
return -EINVAL;
p = procfs_file_alloca(pid, "status");
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 */
/* 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 */
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())
r = sd_bus_message_read(message, "u", &pid);
if (r < 0)
return r;
- if (pid < 0)
+ if (!pid_is_valid((pid_t) pid))
return -EINVAL;
if (pid == 0) {
r = sd_bus_message_read(message, "u", &pid);
if (r < 0)
return r;
- if (pid < 0)
+ if (!pid_is_valid((pid_t) pid))
return -EINVAL;
if (pid == 0) {