diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-06 02:03:04 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-06 02:31:35 +0100 |
commit | d3e84ddb885e9d5f0ae9930eb905910e3a81f157 (patch) | |
tree | 06f15d176ed35af4b825e901e73d8c8629473963 /src/login | |
parent | cd6f997f71c3aba16aa08226d423d14cbc787f82 (diff) |
machined: keep track of the initial leader PID of a machine
This way we can without races always determine the machine for a leader
PID. This allows machine managers to query the machine for a forked off
container/VM without a race where the child might already have died
before we could read the cgroup information from /proc/$PID/cgroup.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-core.c b/src/login/logind-core.c index 6506f22f36..9c31bf8a80 100644 --- a/src/login/logind-core.c +++ b/src/login/logind-core.c @@ -348,7 +348,7 @@ int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session) { r = cg_pid_get_unit(pid, &unit); if (r < 0) - return r; + return 0; s = hashmap_get(m->session_units, unit); if (!s) @@ -371,7 +371,7 @@ int manager_get_user_by_pid(Manager *m, pid_t pid, User **user) { r = cg_pid_get_slice(pid, &unit); if (r < 0) - return r; + return 0; u = hashmap_get(m->user_units, unit); if (!u) |