Skip to content

Commit

Permalink
pid1: ignore error in cg_read_pid()
Browse files Browse the repository at this point in the history
The function append_cgroup() is called recursively, and some subcgroup
may not be read.

Fixes systemd#22089.
  • Loading branch information
yuwata committed Jan 12, 2022
1 parent 18e5664 commit d534a65
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/core/dbus-unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,14 +1309,7 @@ static int append_cgroup(sd_bus_message *reply, const char *p, Set *pids) {
if (r < 0)
return r;

for (;;) {
pid_t pid;

r = cg_read_pid(f, &pid);
if (r < 0)
return r;
if (r == 0)
break;
for (pid_t pid; cg_read_pid(f, &pid) > 0;) {

if (is_kernel_thread(pid) > 0)
continue;
Expand Down

0 comments on commit d534a65

Please sign in to comment.