From c5efb215190711e56547a9075b5750e2e4c497a2 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 25 Nov 2019 07:45:18 -0600 Subject: [PATCH] fu-util-common: Invert default behavior for reboot and shutdown prompts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current behavior for the prompt: ``` Y … Restart & Update y … Restart & Update N … Tool abort & Update complete after next Power cycle n …Tool abort & Update complete after next Power cycle 0 … Pause -> (Push anykey) -> Restart & Update * … Pause -> (Push anykey) -> Restart & Update “”(Enter Only) … Restart & Update ``` If someone just keeps pressing enter without reading the system will reboot which might lead to data loss. Set the default scenario to abort reboot, so they can just see the message to reboot instead. --- src/fu-util-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fu-util-common.c b/src/fu-util-common.c index 72ffdefc7..b67655027 100644 --- a/src/fu-util-common.c +++ b/src/fu-util-common.c @@ -438,7 +438,7 @@ fu_util_prompt_complete (FwupdDeviceFlags flags, gboolean prompt, GError **error _("An update requires the system to shutdown to complete."), /* TRANSLATORS: shutdown to apply the update */ _("Shutdown now?")); - if (!fu_util_prompt_for_boolean (TRUE)) + if (!fu_util_prompt_for_boolean (FALSE)) return TRUE; } return fu_util_update_shutdown (error); @@ -450,7 +450,7 @@ fu_util_prompt_complete (FwupdDeviceFlags flags, gboolean prompt, GError **error _("An update requires a reboot to complete."), /* TRANSLATORS: reboot to apply the update */ _("Restart now?")); - if (!fu_util_prompt_for_boolean (TRUE)) + if (!fu_util_prompt_for_boolean (FALSE)) return TRUE; } return fu_util_update_reboot (error);