summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-02-08 00:56:39 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-02-08 14:10:10 -0500
commitd2a04648a5dbc3d1d043b35257364f0197d4d868 (patch)
treece691395a58e1a965143d0207407f5da39fdb848 /scripts
parentcd58a91def2accba1a07960889e89a63d372119a (diff)
kconfig: remove check_stdin()
Except silentoldconfig, valid_stdin is 1, so check_stdin() is no-op. oldconfig and silentoldconfig work almost in the same way except that the latter generates additional files under include/. Both ask users for input for new symbols. I do not know why only silentoldconfig requires stdio be tty. $ rm -f .config; touch .config $ yes "" | make oldconfig > stdout $ rm -f .config; touch .config $ yes "" | make silentoldconfig > stdout make[1]: *** [silentoldconfig] Error 1 make: *** [silentoldconfig] Error 2 $ tail -n 4 stdout Console input/output is redirected. Run 'make oldconfig' to update configuration. scripts/kconfig/Makefile:40: recipe for target 'silentoldconfig' failed Makefile:507: recipe for target 'silentoldconfig' failed Redirection is useful, for example, for testing where we want to give particular key inputs from a test file, then check the result. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/conf.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index fc446acbf6d6..92111a077680 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -39,7 +39,6 @@ static enum input_mode input_mode = oldaskconfig;
39 39
40static int indent = 1; 40static int indent = 1;
41static int tty_stdio; 41static int tty_stdio;
42static int valid_stdin = 1;
43static int sync_kconfig; 42static int sync_kconfig;
44static int conf_cnt; 43static int conf_cnt;
45static char line[PATH_MAX]; 44static char line[PATH_MAX];
@@ -72,16 +71,6 @@ static void strip(char *str)
72 *p-- = 0; 71 *p-- = 0;
73} 72}
74 73
75static void check_stdin(void)
76{
77 if (!valid_stdin) {
78 printf(_("aborted!\n\n"));
79 printf(_("Console input/output is redirected. "));
80 printf(_("Run 'make oldconfig' to update configuration.\n\n"));
81 exit(1);
82 }
83}
84
85/* Helper function to facilitate fgets() by Jean Sacren. */ 74/* Helper function to facilitate fgets() by Jean Sacren. */
86static void xfgets(char *str, int size, FILE *in) 75static void xfgets(char *str, int size, FILE *in)
87{ 76{
@@ -113,7 +102,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
113 printf("%s\n", def); 102 printf("%s\n", def);
114 return 0; 103 return 0;
115 } 104 }
116 check_stdin();
117 /* fall through */ 105 /* fall through */
118 case oldaskconfig: 106 case oldaskconfig:
119 fflush(stdout); 107 fflush(stdout);
@@ -310,7 +298,6 @@ static int conf_choice(struct menu *menu)
310 printf("%d\n", cnt); 298 printf("%d\n", cnt);
311 break; 299 break;
312 } 300 }
313 check_stdin();
314 /* fall through */ 301 /* fall through */
315 case oldaskconfig: 302 case oldaskconfig:
316 fflush(stdout); 303 fflush(stdout);
@@ -645,7 +632,6 @@ int main(int ac, char **av)
645 return 1; 632 return 1;
646 } 633 }
647 } 634 }
648 valid_stdin = tty_stdio;
649 } 635 }
650 636
651 switch (input_mode) { 637 switch (input_mode) {