diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 7ca3bb7..90c7b2e 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -795,8 +795,21 @@ static void conf_save(void) } } -static int handle_exit(int res) +static int handle_exit(int fatal) { + int res; + + dialog_clear(); + if (conf_get_changed()) + res = dialog_yesno(NULL, + _("Do you wish to save your new configuration ?\n" + " to continue."), + 6, 60); + else + res = -1; + + end_dialog(saved_x, saved_y); + switch (res) { case 0: if (conf_write(filename)) { @@ -812,6 +825,7 @@ static int handle_exit(int res) "*** End of the configuration.\n" "*** Execute 'make' to start the build or try 'make help'." "\n\n")); + res = 0; break; default: fprintf(stderr, _("\n\n" @@ -819,26 +833,13 @@ static int handle_exit(int res) "\n\n")); } - return 0; + return res; } static void sig_handler(int signo __attribute__((__unused__))) { - int res; - - do { - dialog_clear(); - if (conf_get_changed()) - res = dialog_yesno(NULL, - _("Do you wish to save your " - "new configuration?\n"), - 6, 60); - else - res = -1; - } while (res == KEY_ESC); - end_dialog(saved_x, saved_y); - exit(handle_exit(res)); + exit(handle_exit(1)); } int main(int ac, char **av) @@ -873,18 +874,9 @@ int main(int ac, char **av) set_config_filename(conf_get_configname()); do { conf(&rootmenu); - dialog_clear(); - if (conf_get_changed()) - res = dialog_yesno(NULL, - _("Do you wish to save your " - "new configuration?\n" - " to continue."), - 6, 60); - else - res = -1; + res = handle_exit(0); } while (res == KEY_ESC); - end_dialog(saved_x, saved_y); - return handle_exit(res); + return res; }