| 904 | } |
| 905 | |
| 906 | static int handle_exit(void) |
| 907 | { |
| 908 | int res; |
| 909 | |
| 910 | save_and_exit = 1; |
| 911 | reset_subtitle(); |
| 912 | dialog_clear(); |
| 913 | if (conf_get_changed()) |
| 914 | res = dialog_yesno(NULL, |
| 915 | "Do you wish to save your new configuration?\n" |
| 916 | "(Press <ESC><ESC> to continue kernel configuration.)", |
| 917 | 6, 60); |
| 918 | else |
| 919 | res = -1; |
| 920 | |
| 921 | end_dialog(saved_x, saved_y); |
| 922 | |
| 923 | switch (res) { |
| 924 | case 0: |
| 925 | if (conf_write(filename)) { |
| 926 | fprintf(stderr, "\n\n" |
| 927 | "Error while writing of the configuration.\n" |
| 928 | "Your configuration changes were NOT saved." |
| 929 | "\n\n"); |
| 930 | return 1; |
| 931 | } |
| 932 | conf_write_autoconf(0); |
| 933 | /* fall through */ |
| 934 | case -1: |
| 935 | if (!silent) |
| 936 | printf("\n\n" |
| 937 | "*** End of the configuration.\n" |
| 938 | "*** Execute 'make' to start the build or try 'make help'." |
| 939 | "\n\n"); |
| 940 | res = 0; |
| 941 | break; |
| 942 | default: |
| 943 | if (!silent) |
| 944 | fprintf(stderr, "\n\n" |
| 945 | "Your configuration changes were NOT saved." |
| 946 | "\n\n"); |
| 947 | if (res != KEY_ESC) |
| 948 | res = 0; |
| 949 | } |
| 950 | |
| 951 | return res; |
| 952 | } |
| 953 | |
| 954 | static void sig_handler(int signo) |
| 955 | { |
no test coverage detected