summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-02-11 13:54:10 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2014-02-11 13:54:10 +0000
commit3386b4b2866b991b49e7386d51a3f4b9d9b681c0 (patch)
tree73cf03a54affb367edc1b5f5623305a7dd9c3219 /lib
parent0d5de66fc6b85a0555ecc9d853e48c464122bb26 (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.c3
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 );