mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-26 09:57:26 +03:00
cgroup: properly determine cgroups zombie processes belong to
When a process becomes a zombie its cgroup might be deleted. Let's add some minimal code to detect cases like this, so that we can still attribute this back to the original cgroup.
This commit is contained in:
parent
77fa610b22
commit
5e20b0a452
@ -1104,6 +1104,11 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Truncate suffix indicating the process is a zombie */
|
||||
e = endswith(p, " (deleted)");
|
||||
if (e)
|
||||
*e = 0;
|
||||
|
||||
*path = p;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user