summaryrefslogtreecommitdiff
path: root/src/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mount.c')
-rw-r--r--src/mount.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mount.c b/src/mount.c
index 5577f16dfd..a8f3d7b9aa 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -921,12 +921,14 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
assert(m);
assert(pid >= 0);
- success = is_clean_exit(code, status);
- m->failure = m->failure || !success;
+ if (pid != m->control_pid)
+ return;
- assert(m->control_pid == pid);
m->control_pid = 0;
+ success = is_clean_exit(code, status);
+ m->failure = m->failure || !success;
+
if (m->control_command) {
exec_status_fill(&m->control_command->exec_status, pid, code, status);
m->control_command = NULL;