tree-wide: use pidref_is_self() at more places

This commit is contained in:
Lennart Poettering
2024-12-18 13:34:35 +01:00
parent 4c9f242a54
commit 9aee971185
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -429,7 +429,7 @@ int pidref_wait(const PidRef *pidref, siginfo_t *ret, int options) {
if (pidref_is_remote(pidref))
return -EREMOTE;
if (pidref->pid == 1 || pidref->pid == getpid_cached())
if (pidref->pid == 1 || pidref_is_self(pidref))
return -ECHILD;
siginfo_t si = {};
@@ -81,7 +81,7 @@ static void *server(void *p) {
_cleanup_(pidref_done) PidRef pidref = PIDREF_NULL;
assert_se(pidref_set_pidfd_take(&pidref, pidfd) >= 0);
assert_se(pidref.pid == getpid_cached());
assert_se(pidref_is_self(&pidref));
}
const gid_t *gl = NULL;
+1 -1
View File
@@ -879,7 +879,7 @@ static int create_session(
if (r < 0)
return r;
if (leader.pid == 1 || leader.pid == getpid_cached())
if (leader.pid == 1 || pidref_is_self(&leader))
return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid leader PID");
if (isempty(type))