chiark / gitweb /
notify: add minimal readiness/status protocol for spawned daemons
[elogind.git] / src / mount.c
index 5577f16dfd7a18ff0cba8919d27bfc886d0d7129..a8f3d7b9aac7741e46afcf6b304970eb44e567e9 100644 (file)
@@ -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;