20-isatty.diff 420 B

123456789101112131415161718
  1. Author: Jakub Wilk <jwilk@debian.org>
  2. Description: Do not hang forever if stdin is redirected to /dev/null.
  3. Bug-Debian: https://bugs.debian.org/775511
  4. --- a/source/apps/exe/input/lin.c
  5. +++ b/source/apps/exe/input/lin.c
  6. @@ -40,6 +40,10 @@ BOOL APPS_EXE_INPUT_KeyHit(void)
  7. fd_set fds;
  8. struct timeval tv;
  9. + if (!isatty(0))
  10. + {
  11. + return 0;
  12. + }
  13. FD_ZERO(&fds);
  14. FD_SET(0, &fds);
  15. tv.tv_sec = 0;