lib: Don't wait in igt_wait_for_keypress() if stdin is not a tty
authorDamien Lespiau <damien.lespiau@intel.com>
Tue, 11 Feb 2014 13:54:10 +0000 (13:54 +0000)
committerDamien Lespiau <damien.lespiau@intel.com>
Tue, 11 Feb 2014 13:54:10 +0000 (13:54 +0000)
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>
lib/drmtest.c

index 24362bd..28651ce 100644 (file)
@@ -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 );