| 969 | } |
| 970 | |
| 971 | static 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 | |
| 1019 | static void sig_handler(int signo) |
| 1020 | { |
no test coverage detected