summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-02 16:01:16 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-02 16:01:16 +0200
commit7b2fd9d51259f6cf350791434e640ac3519acc6c (patch)
tree00774b073be5267c8293a9dfe5dfea7e059ec739 /src
parentab932a622d57fd327ef95992c343fd4425324088 (diff)
core: remove duplicate code in automount_update_mount()
Also, fix indentation.
Diffstat (limited to 'src')
-rw-r--r--src/core/automount.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index c871b02a94..464d6a70c0 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -477,39 +477,22 @@ int automount_update_mount(Automount *a, MountState old_state, MountState state)
if (r < 0)
log_unit_warning_errno(UNIT(a), r, "Failed to start expiration timer, ignoring: %m");
break;
- case MOUNT_DEAD:
- case MOUNT_UNMOUNTING:
- case MOUNT_MOUNTING_SIGTERM:
- case MOUNT_MOUNTING_SIGKILL:
- case MOUNT_REMOUNTING_SIGTERM:
- case MOUNT_REMOUNTING_SIGKILL:
- case MOUNT_UNMOUNTING_SIGTERM:
- case MOUNT_UNMOUNTING_SIGKILL:
- case MOUNT_FAILED:
+
+ case MOUNT_DEAD:
+ case MOUNT_UNMOUNTING:
+ case MOUNT_MOUNTING_SIGTERM:
+ case MOUNT_MOUNTING_SIGKILL:
+ case MOUNT_REMOUNTING_SIGTERM:
+ case MOUNT_REMOUNTING_SIGKILL:
+ case MOUNT_UNMOUNTING_SIGTERM:
+ case MOUNT_UNMOUNTING_SIGKILL:
+ case MOUNT_FAILED:
if (old_state != state)
automount_send_ready(a, a->tokens, -ENODEV);
+
(void) sd_event_source_set_enabled(a->expire_event_source, SD_EVENT_OFF);
break;
- default:
- break;
- }
- switch (state) {
- case MOUNT_DEAD:
- automount_send_ready(a, a->expire_tokens, 0);
- break;
- case MOUNT_MOUNTING:
- case MOUNT_MOUNTING_DONE:
- case MOUNT_MOUNTING_SIGTERM:
- case MOUNT_MOUNTING_SIGKILL:
- case MOUNT_REMOUNTING_SIGTERM:
- case MOUNT_REMOUNTING_SIGKILL:
- case MOUNT_UNMOUNTING_SIGTERM:
- case MOUNT_UNMOUNTING_SIGKILL:
- case MOUNT_FAILED:
- if (old_state != state)
- automount_send_ready(a, a->expire_tokens, -ENODEV);
- break;
default:
break;
}