From c7c6cf2031c1c0eb1839d2ea83b5a8de4af6da00 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 12 Feb 2025 14:56:34 +0100 Subject: [PATCH] core/mount: trivial coding style cleanups --- src/core/mount.c | 7 +++---- src/core/mount.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/mount.c b/src/core/mount.c index 9632a12ca67..779c8db77ce 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -45,9 +45,9 @@ static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { [MOUNT_MOUNTING_DONE] = UNIT_ACTIVATING, [MOUNT_MOUNTED] = UNIT_ACTIVE, [MOUNT_REMOUNTING] = UNIT_RELOADING, - [MOUNT_UNMOUNTING] = UNIT_DEACTIVATING, [MOUNT_REMOUNTING_SIGTERM] = UNIT_RELOADING, [MOUNT_REMOUNTING_SIGKILL] = UNIT_RELOADING, + [MOUNT_UNMOUNTING] = UNIT_DEACTIVATING, [MOUNT_UNMOUNTING_SIGTERM] = UNIT_DEACTIVATING, [MOUNT_UNMOUNTING_SIGKILL] = UNIT_DEACTIVATING, [MOUNT_FAILED] = UNIT_FAILED, @@ -1056,6 +1056,8 @@ static void mount_enter_unmounting(Mount *m) { MOUNT_UNMOUNTING_SIGKILL)) m->n_retry_umount = 0; + mount_unwatch_control_pid(m); + m->control_command_id = MOUNT_EXEC_UNMOUNT; m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT; @@ -1065,8 +1067,6 @@ static void mount_enter_unmounting(Mount *m) { goto fail; } - mount_unwatch_control_pid(m); - r = mount_spawn(m, m->control_command, mount_exec_flags(MOUNT_UNMOUNTING), &m->control_pid); if (r < 0) { log_unit_warning_errno(UNIT(m), r, "Failed to spawn 'umount' task: %m"); @@ -1074,7 +1074,6 @@ static void mount_enter_unmounting(Mount *m) { } mount_set_state(m, MOUNT_UNMOUNTING); - return; fail: diff --git a/src/core/mount.h b/src/core/mount.h index 28cc7785d88..a8ae25e638e 100644 --- a/src/core/mount.h +++ b/src/core/mount.h @@ -81,7 +81,7 @@ struct Mount { MountState state, deserialized_state; - ExecCommand* control_command; + ExecCommand *control_command; MountExecCommand control_command_id; PidRef control_pid; -- 2.47.3