aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/conf.c18
-rw-r--r--scripts/kconfig/qconf.h6
2 files changed, 19 insertions, 5 deletions
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)
63 } 63 }
64} 64}
65 65
66static char *fgets_check_stream(char *s, int size, FILE *stream)
67{
68 char *ret = fgets(s, size, stream);
69
70 if (ret == NULL && feof(stream)) {
71 printf(_("aborted!\n\n"));
72 printf(_("Console input is closed. "));
73 printf(_("Run 'make oldconfig' to update configuration.\n\n"));
74 exit(1);
75 }
76
77 return ret;
78}
79
66static void conf_askvalue(struct symbol *sym, const char *def) 80static void conf_askvalue(struct symbol *sym, const char *def)
67{ 81{
68 enum symbol_type type = sym_get_type(sym); 82 enum symbol_type type = sym_get_type(sym);
@@ -100,7 +114,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
100 check_stdin(); 114 check_stdin();
101 case ask_all: 115 case ask_all:
102 fflush(stdout); 116 fflush(stdout);
103 fgets(line, 128, stdin); 117 fgets_check_stream(line, 128, stdin);
104 return; 118 return;
105 case set_default: 119 case set_default:
106 printf("%s\n", def); 120 printf("%s\n", def);
@@ -356,7 +370,7 @@ static int conf_choice(struct menu *menu)
356 check_stdin(); 370 check_stdin();
357 case ask_all: 371 case ask_all:
358 fflush(stdout); 372 fflush(stdout);
359 fgets(line, 128, stdin); 373 fgets_check_stream(line, 128, stdin);
360 strip(line); 374 strip(line);
361 if (line[0] == '?') { 375 if (line[0] == '?') {
362 printf("\n%s\n", menu->sym->help ? 376 printf("\n%s\n", menu->sym->help ?
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 7c03927d4c7c..e52f3e90bf0c 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -22,8 +22,8 @@ public:
22 22
23#if QT_VERSION >= 300 23#if QT_VERSION >= 300
24 void readListSettings(); 24 void readListSettings();
25 QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok); 25 QValueList<int> readSizes(const QString& key, bool *ok);
26 bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value); 26 bool writeSizes(const QString& key, const QValueList<int>& value);
27#endif 27#endif
28 28
29 bool showAll; 29 bool showAll;
@@ -124,7 +124,7 @@ public:
124 void setParentMenu(void); 124 void setParentMenu(void);
125 125
126 template <class P> 126 template <class P>
127 void ConfigList::updateMenuList(P*, struct menu*); 127 void updateMenuList(P*, struct menu*);
128 128
129 bool updateAll; 129 bool updateAll;
130 130