diff --git a/src/core/mount.c b/src/core/mount.c index 94aeea9f6c9..cf2d839347b 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1554,13 +1554,9 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { /* MOUNT_MOUNTING and MOUNT_UNMOUNTING states need to be patched, see below. */ m->result = f; - if (m->control_command) { + if (m->control_command) exec_status_exit(&m->control_command->exec_status, &m->exec_context, pid, code, status); - m->control_command = NULL; - m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID; - } - unit_log_process_exit( u, "Mount process", @@ -1568,6 +1564,9 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { f == MOUNT_SUCCESS, code, status); + m->control_command = NULL; + m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID; + /* Note that due to the io event priority logic, we can be sure the new mountinfo is loaded * before we process the SIGCHLD for the mount command. */