summaryrefslogtreecommitdiffstats
path: root/package/xvisor/0002-openconf-do-not-check-stdin.patch
blob: 34b350de42a43b616723b3cf4e5039ebbecb68b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 6b49c1dbe0ac43e39eec97a7e79cf5fb995747dc Mon Sep 17 00:00:00 2001
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Date: Mon, 12 Sep 2016 21:49:55 +0530
Subject: [PATCH] openconf: do not check stdin

Do not check if stdin is redirected when ask_silent is true, so the
`yes` program can be used to answer the questions about new values.

Example:

  yes "" | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Anup Patel <anup@brainfault.org>
---
 tools/openconf/conf.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/tools/openconf/conf.c b/tools/openconf/conf.c
index a428058..711cf0b 100644
--- a/tools/openconf/conf.c
+++ b/tools/openconf/conf.c
@@ -65,16 +65,6 @@ static void strip(char *str)
 		*p-- = 0;
 }
 
-static void check_stdin(void)
-{
-	if (!valid_stdin) {
-		printf("aborted!\n\n");
-		printf("Console input/output is redirected. ");
-		printf("Run 'make oldconfig' to update configuration.\n\n");
-		exit(1);
-	}
-}
-
 static int conf_askvalue(struct symbol *sym, const char *def)
 {
 	char *ret;
@@ -100,7 +90,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 			printf("%s\n", def);
 			return 0;
 		}
-		check_stdin();
 	case ask_all:
 		fflush(stdout);
 		ret = fgets(line, 128, stdin);
@@ -306,7 +295,6 @@ static int conf_choice(struct menu *menu)
 				printf("%d\n", cnt);
 				break;
 			}
-			check_stdin();
 		case ask_all:
 			fflush(stdout);
 			ret = fgets(line, 128, stdin);
-- 
2.4.11

OpenPOWER on IntegriCloud