diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2014-02-11 13:54:10 +0000 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2014-02-11 13:54:10 +0000 |
commit | 3386b4b2866b991b49e7386d51a3f4b9d9b681c0 (patch) | |
tree | 73cf03a54affb367edc1b5f5623305a7dd9c3219 /lib | |
parent | 0d5de66fc6b85a0555ecc9d853e48c464122bb26 (diff) |
lib: Don't wait in igt_wait_for_keypress() if stdin is not a tty
When running in a non interactive terminal, there's little point in
trying to wait for some input on stdin.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/drmtest.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 24362bd4..28651cee 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1710,6 +1710,9 @@ void igt_wait_for_keypress(void) { struct termios oldt, newt; + if (!isatty(STDIN_FILENO)) + return; + tcgetattr ( STDIN_FILENO, &oldt ); newt = oldt; newt.c_lflag &= ~( ICANON | ECHO ); |