MCPcopy Create free account
hub / github.com/coreboot/coreboot / do_exit

Function do_exit

util/kconfig/nconf.c:651–692  ·  view source on GitHub ↗

return = 0 means we are successful. * -1 means go on doing what you were doing */

Source from the content-addressed store, hash-verified

649 * -1 means go on doing what you were doing
650 */
651static int do_exit(void)
652{
653 int res;
654 if (!conf_get_changed()) {
655 global_exit = 1;
656 return 0;
657 }
658 res = btn_dialog(main_window,
659 "Do you wish to save your new configuration?\n"
660 "<ESC> to cancel and resume nconfig.",
661 2,
662 " <save> ",
663 "<don't save>");
664 if (res == KEY_EXIT) {
665 global_exit = 0;
666 return -1;
667 }
668
669 /* if we got here, the user really wants to exit */
670 switch (res) {
671 case 0:
672 res = conf_write(filename);
673 if (res)
674 btn_dialog(
675 main_window,
676 "Error during writing of configuration.\n"
677 "Your configuration changes were NOT saved.",
678 1,
679 "<OK>");
680 conf_write_autoconf(0);
681 break;
682 default:
683 btn_dialog(
684 main_window,
685 "Your configuration changes were NOT saved.",
686 1,
687 "<OK>");
688 break;
689 }
690 global_exit = 1;
691 return 0;
692}
693
694
695static void search_conf(void)

Callers 2

handle_f9Function · 0.85
mainFunction · 0.85

Calls 4

conf_get_changedFunction · 0.85
btn_dialogFunction · 0.85
conf_writeFunction · 0.85
conf_write_autoconfFunction · 0.85

Tested by

no test coverage detected