MCPcopy Create free account
hub / github.com/Entware/Entware / handle_exit

Function handle_exit

scripts/config/mconf.c:971–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971static int handle_exit(void)
972{
973 int res;
974
975 save_and_exit = 1;
976 reset_subtitle();
977 dialog_clear();
978 if (conf_get_changed())
979 res = dialog_yesno(NULL,
980 "Do you wish to save your new configuration?\n"
981 "(Press <ESC><ESC> to continue kernel configuration.)",
982 6, 60);
983 else
984 res = -1;
985
986 end_dialog(saved_x, saved_y);
987
988 switch (res) {
989 case 0:
990 if (conf_write(filename)) {
991 fprintf(stderr, "\n\n"
992 "Error while writing of the configuration.\n"
993 "Your configuration changes were NOT saved."
994 "\n\n");
995 return 1;
996 }
997 conf_write_autoconf(0);
998 /* fall through */
999 case -1:
1000 if (!silent)
1001 printf("\n\n"
1002 "*** End of the configuration.\n"
1003 "*** Execute 'make' to start the build or try 'make help'."
1004 "\n\n");
1005 res = 0;
1006 break;
1007 default:
1008 if (!silent)
1009 fprintf(stderr, "\n\n"
1010 "Your configuration changes were NOT saved."
1011 "\n\n");
1012 if (res != KEY_ESC)
1013 res = 0;
1014 }
1015
1016 return res;
1017}
1018
1019static void sig_handler(int signo)
1020{

Callers 2

sig_handlerFunction · 0.85
mainFunction · 0.85

Calls 7

reset_subtitleFunction · 0.85
dialog_clearFunction · 0.85
conf_get_changedFunction · 0.85
dialog_yesnoFunction · 0.85
end_dialogFunction · 0.85
conf_writeFunction · 0.85
conf_write_autoconfFunction · 0.85

Tested by

no test coverage detected