X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=scripts%2Fkconfig%2Fconf.c;h=10eeae53d827f904a440c812af8febd13c891776;hb=c5111f504d2a9b0d258d7c4752b4093523315989;hp=8ba5d29d3d42d1221b2fdc1b6e137ca750513da8;hpb=1ef43204f4bd24dcd3156185b19b31b6b4151ae9;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 8ba5d29d3d42..10eeae53d827 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -63,6 +63,20 @@ static void check_stdin(void) } } +static char *fgets_check_stream(char *s, int size, FILE *stream) +{ + char *ret = fgets(s, size, stream); + + if (ret == NULL && feof(stream)) { + printf(_("aborted!\n\n")); + printf(_("Console input is closed. ")); + printf(_("Run 'make oldconfig' to update configuration.\n\n")); + exit(1); + } + + return ret; +} + static void conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); @@ -100,7 +114,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) check_stdin(); case ask_all: fflush(stdout); - fgets(line, 128, stdin); + fgets_check_stream(line, 128, stdin); return; case set_default: printf("%s\n", def); @@ -356,7 +370,7 @@ static int conf_choice(struct menu *menu) check_stdin(); case ask_all: fflush(stdout); - fgets(line, 128, stdin); + fgets_check_stream(line, 128, stdin); strip(line); if (line[0] == '?') { printf("\n%s\n", menu->sym->help ?