From 3386b4b2866b991b49e7386d51a3f4b9d9b681c0 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Tue, 11 Feb 2014 13:54:10 +0000 Subject: 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 --- lib/drmtest.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/drmtest.c') 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 ); -- cgit v1.2.3