Merge pull request #31886 from DaanDeMeyer/logind
logind: Add fallback for when the PIDFDs= property is not available
This commit is contained in:
@@ -297,15 +297,12 @@ int allocate_scope(
|
||||
|
||||
description = strjoina("Container ", machine_name);
|
||||
|
||||
if (allow_pidfd) {
|
||||
_cleanup_(pidref_done) PidRef pidref = PIDREF_NULL;
|
||||
r = pidref_set_pid(&pidref, pid);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to allocate PID reference: %m");
|
||||
_cleanup_(pidref_done) PidRef pidref = PIDREF_NULL;
|
||||
r = pidref_set_pid(&pidref, pid);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to allocate PID reference: %m");
|
||||
|
||||
r = bus_append_scope_pidref(m, &pidref);
|
||||
} else
|
||||
r = sd_bus_message_append(m, "(sv)", "PIDs", "au", 1, (uint32_t) pid);
|
||||
r = bus_append_scope_pidref(m, &pidref, allow_pidfd);
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user