tree-wide: use pidref_is_self() at more places
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user