summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/basic/cgroup-util.c4
-rw-r--r--src/core/cgroup.c2
-rw-r--r--src/core/dbus-unit.c2
-rw-r--r--src/shared/bus-unit-procs.c5
-rw-r--r--src/systemctl/systemctl.c3
5 files changed, 10 insertions, 6 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index da37b52dbe..dff6543bf5 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -388,7 +388,7 @@ int cg_kill_recursive(
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
- p = path_join(path, fn);
+ p = path_join(empty_to_root(path), fn);
free(fn);
if (!p)
return -ENOMEM;
@@ -522,7 +522,7 @@ int cg_migrate_recursive(
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
- p = path_join(pfrom, fn);
+ p = path_join(empty_to_root(pfrom), fn);
free(fn);
if (!p)
return -ENOMEM;
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 0428f62481..9a1aec144e 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -2490,7 +2490,7 @@ static int unit_watch_pids_in_path(Unit *u, const char *path) {
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
- p = path_join(path, fn);
+ p = path_join(empty_to_root(path), fn);
free(fn);
if (!p)
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 53daa9c2ec..220b4c2372 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -1062,7 +1062,7 @@ static int append_cgroup(sd_bus_message *reply, const char *p, Set *pids) {
if (r == 0)
break;
- j = path_join(p, g);
+ j = path_join(empty_to_root(p), g);
if (!j)
return -ENOMEM;
diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c
index aeba2ebfd3..054a1410ac 100644
--- a/src/shared/bus-unit-procs.c
+++ b/src/shared/bus-unit-procs.c
@@ -387,8 +387,11 @@ int unit_show_processes(
break;
r = add_process(cgroups, path, pid, name);
- if (r < 0)
+ if (r == -ENOMEM)
goto finish;
+ if (r < 0)
+ log_warning_errno(r, "Invalid process description in GetUnitProcesses reply: cgroup=\"%s\" pid="PID_FMT" command=\"%s\", ignoring: %m",
+ path, pid, name);
}
r = sd_bus_message_exit_container(reply);
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 8e964214d1..10e372d3a4 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4548,7 +4548,8 @@ static void print_status_info(
show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, i->control_group, prefix, c, extra, k, get_output_flags());
} else if (r < 0)
- log_warning_errno(r, "Failed to dump process list for '%s', ignoring: %s", i->id, bus_error_message(&error, r));
+ log_warning_errno(r, "Failed to dump process list for '%s', ignoring: %s",
+ i->id, bus_error_message(&error, r));
}
if (i->id && arg_transport == BUS_TRANSPORT_LOCAL)