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>
This commit is contained in:
Damien Lespiau 2014-02-11 13:54:10 +00:00
parent 0d5de66fc6
commit 3386b4b286

View 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 );