summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-03 14:57:44 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-04 09:07:31 +0200
commitb3ac818be8d73c97dc4f74ba8bbd2091506df2e6 (patch)
treeb2c5055a9ba2fd3da48005e305ad27d3d273de9b /src/core/manager.c
parent569b19d8fedc4525a6c15f1a3ab9c15dcb7c694a (diff)
core: split up manager_get_unit_by_pid()
Let's move the actual cgroup part of it into a new separate function manager_get_unit_by_pid_cgroup(), and then make manager_get_unit_by_pid() just a wrapper that also checks the two pid hashmaps. Then, let's make sure the various calls that want to deliver events to the owners of a PID check both hashmaps and the cgroup and deliver the event to *each* of them. OTOH make sure bus calls like GetUnitByPID() continue to check the PID hashmaps first and the cgroup only as fallback.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index c2d262a5d3..fc10ddb5d9 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1585,7 +1585,7 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
/* Notify every unit that might be interested, but try
* to avoid notifying the same one multiple times. */
- u1 = manager_get_unit_by_pid(m, ucred->pid);
+ u1 = manager_get_unit_by_pid_cgroup(m, ucred->pid);
if (u1) {
manager_invoke_notify_message(m, u1, ucred->pid, buf, n, fds);
found = true;
@@ -1663,7 +1663,7 @@ static int manager_dispatch_sigchld(Manager *m) {
/* And now figure out the unit this belongs
* to, it might be multiple... */
- u1 = manager_get_unit_by_pid(m, si.si_pid);
+ u1 = manager_get_unit_by_pid_cgroup(m, si.si_pid);
if (u1)
invoke_sigchld_event(m, u1, &si);
u2 = hashmap_get(m->watch_pids1, PID_TO_PTR(si.si_pid));