1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-29 06:50:16 +03:00

Merge pull request #13063 from keszybz/cgroup-path-fixes

Cgroup path fixes
This commit is contained in:
Lennart Poettering 2019-07-16 11:53:31 +02:00 committed by GitHub
commit f200a3564c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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)