chiark / gitweb /
typo: the correct spelling is maintenance not maintainance
[elogind.git] / src / mount.c
index 5577f16dfd7a18ff0cba8919d27bfc886d0d7129..4a38e957003d6b8c14cc5d8d0ba6b2f14f13725d 100644 (file)
@@ -49,7 +49,7 @@ static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
         [MOUNT_REMOUNTING_SIGKILL] = UNIT_ACTIVE_RELOADING,
         [MOUNT_UNMOUNTING_SIGTERM] = UNIT_DEACTIVATING,
         [MOUNT_UNMOUNTING_SIGKILL] = UNIT_DEACTIVATING,
-        [MOUNT_MAINTAINANCE] = UNIT_INACTIVE,
+        [MOUNT_MAINTENANCE] = UNIT_INACTIVE,
 };
 
 static void mount_init(Unit *u) {
@@ -416,7 +416,7 @@ static void mount_set_state(Mount *m, MountState state) {
                  state == MOUNT_REMOUNTING_SIGKILL ||
                  state == MOUNT_UNMOUNTING_SIGTERM ||
                  state == MOUNT_UNMOUNTING_SIGKILL ||
-                 state == MOUNT_MAINTAINANCE)
+                 state == MOUNT_MAINTENANCE)
                 mount_notify_automount(m, -ENODEV);
 
         if (state != old_state)
@@ -555,7 +555,7 @@ static void mount_enter_dead(Mount *m, bool success) {
         if (!success)
                 m->failure = true;
 
-        mount_set_state(m, m->failure ? MOUNT_MAINTAINANCE : MOUNT_DEAD);
+        mount_set_state(m, m->failure ? MOUNT_MAINTENANCE : MOUNT_DEAD);
 }
 
 static void mount_enter_mounted(Mount *m, bool success) {
@@ -780,7 +780,7 @@ static int mount_start(Unit *u) {
             m->state == MOUNT_MOUNTING_SIGKILL)
                 return 0;
 
-        assert(m->state == MOUNT_DEAD || m->state == MOUNT_MAINTAINANCE);
+        assert(m->state == MOUNT_DEAD || m->state == MOUNT_MAINTENANCE);
 
         m->failure = false;
         mount_enter_mounting(m);
@@ -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;
@@ -1433,7 +1435,7 @@ void mount_fd_event(Manager *m, int events) {
                         switch (mount->state) {
 
                         case MOUNT_DEAD:
-                        case MOUNT_MAINTAINANCE:
+                        case MOUNT_MAINTENANCE:
                                 mount_enter_mounted(mount, true);
                                 break;
 
@@ -1521,7 +1523,7 @@ static const char* const mount_state_table[_MOUNT_STATE_MAX] = {
         [MOUNT_REMOUNTING_SIGKILL] = "remounting-sigkill",
         [MOUNT_UNMOUNTING_SIGTERM] = "unmounting-sigterm",
         [MOUNT_UNMOUNTING_SIGKILL] = "unmounting-sigkill",
-        [MOUNT_MAINTAINANCE] = "maintainance"
+        [MOUNT_MAINTENANCE] = "maintenance"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(mount_state, MountState);