summaryrefslogtreecommitdiffstats
path: root/src/nspawn/nspawn-register.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-03-22 17:03:35 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-03-22 17:03:35 +0100
commit66b574b0a278d810ea6367fec84f70318bc3ae44 (patch)
tree08ddbb1cb124f8c8898c01d5d7ddce086ddc40e7 /src/nspawn/nspawn-register.c
parentlogind: Add fallback for when the PIDFDs= property is not available (diff)
downloadsystemd-66b574b0a278d810ea6367fec84f70318bc3ae44.tar.xz
systemd-66b574b0a278d810ea6367fec84f70318bc3ae44.zip
tree-wide: Add allow_pidfd argument to bus_append_scope_pidref()
Diffstat (limited to 'src/nspawn/nspawn-register.c')
-rw-r--r--src/nspawn/nspawn-register.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/nspawn/nspawn-register.c b/src/nspawn/nspawn-register.c
index 358958b82b..b63516d13e 100644
--- a/src/nspawn/nspawn-register.c
+++ b/src/nspawn/nspawn-register.c
@@ -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);