0002-openconf-do-not-check-stdin.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 6b49c1dbe0ac43e39eec97a7e79cf5fb995747dc Mon Sep 17 00:00:00 2001
  2. From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
  3. Date: Mon, 12 Sep 2016 21:49:55 +0530
  4. Subject: [PATCH] openconf: do not check stdin
  5. Do not check if stdin is redirected when ask_silent is true, so the
  6. `yes` program can be used to answer the questions about new values.
  7. Example:
  8. yes "" | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig
  9. Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
  10. Signed-off-by: Anup Patel <anup@brainfault.org>
  11. ---
  12. tools/openconf/conf.c | 12 ------------
  13. 1 file changed, 12 deletions(-)
  14. diff --git a/tools/openconf/conf.c b/tools/openconf/conf.c
  15. index a428058..711cf0b 100644
  16. --- a/tools/openconf/conf.c
  17. +++ b/tools/openconf/conf.c
  18. @@ -65,16 +65,6 @@ static void strip(char *str)
  19. *p-- = 0;
  20. }
  21. -static void check_stdin(void)
  22. -{
  23. - if (!valid_stdin) {
  24. - printf("aborted!\n\n");
  25. - printf("Console input/output is redirected. ");
  26. - printf("Run 'make oldconfig' to update configuration.\n\n");
  27. - exit(1);
  28. - }
  29. -}
  30. -
  31. static int conf_askvalue(struct symbol *sym, const char *def)
  32. {
  33. char *ret;
  34. @@ -100,7 +90,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
  35. printf("%s\n", def);
  36. return 0;
  37. }
  38. - check_stdin();
  39. case ask_all:
  40. fflush(stdout);
  41. ret = fgets(line, 128, stdin);
  42. @@ -306,7 +295,6 @@ static int conf_choice(struct menu *menu)
  43. printf("%d\n", cnt);
  44. break;
  45. }
  46. - check_stdin();
  47. case ask_all:
  48. fflush(stdout);
  49. ret = fgets(line, 128, stdin);
  50. --
  51. 2.4.11