summaryrefslogtreecommitdiff
path: root/src/core/cgroup.c
diff options
context:
space:
mode:
authorjosh-gordon-fb <110699866+josh-gordon-fb@users.noreply.github.com>2022-08-09 00:20:07 -0700
committerGitHub <noreply@github.com>2022-08-09 16:20:07 +0900
commit78fa2f91d208b51f2a4878012b9558389e9a7660 (patch)
tree0350ec1665965241f153cee718d639b7e24c5c4e /src/core/cgroup.c
parentb607fd3f32c3ef36795a5bce92ec7f31c48bc9d9 (diff)
downloadsystemd-78fa2f91d208b51f2a4878012b9558389e9a7660.tar.gz
core/cgroup: use bus locator (#24251)
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r--src/core/cgroup.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 871d79e0d2..8b38934615 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -13,6 +13,7 @@
#include "bpf-socket-bind.h"
#include "btrfs-util.h"
#include "bus-error.h"
+#include "bus-locator.h"
#include "cgroup-setup.h"
#include "cgroup-util.h"
#include "cgroup.h"
@@ -2261,14 +2262,12 @@ static int unit_attach_pid_to_cgroup_via_bus(Unit *u, pid_t pid, const char *suf
pp = strjoina("/", pp, suffix_path);
path_simplify(pp);
- r = sd_bus_call_method(u->manager->system_bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "AttachProcessesToUnit",
- &error, NULL,
- "ssau",
- NULL /* empty unit name means client's unit, i.e. us */, pp, 1, (uint32_t) pid);
+ r = bus_call_method(u->manager->system_bus,
+ bus_systemd_mgr,
+ "AttachProcessesToUnit",
+ &error, NULL,
+ "ssau",
+ NULL /* empty unit name means client's unit, i.e. us */, pp, 1, (uint32_t) pid);
if (r < 0)
return log_unit_debug_errno(u, r, "Failed to attach unit process " PID_FMT " via the bus: %s", pid, bus_error_message(&error, r));