diff options
author | Thomas Wood <thomas.wood@intel.com> | 2014-07-24 17:45:48 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2014-07-25 14:46:51 +0100 |
commit | 8408e00e623b52f18ad0795122593741197fa2f4 (patch) | |
tree | c4ba4c55cabc2c68b95312641fa4a01e2055de55 | |
parent | b9e7637542364f9834c620ce2ee3b4ca11ba6f27 (diff) |
testdisplay: only set terminal attributes when in foreground process group
The Piglit test runner for intel-gpu-tools creates a new process group
for the test processes, so attempting to set terminal attributes causes
the process to receive SIGTTOU and be stopped. Since the test is not run
interactively in this case, the issue can be avoided by not setting
terminal attributes if the process is not in the foreground process
group.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
-rw-r--r-- | tests/testdisplay.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 6d8fe3ad1..f60e66d50 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -725,6 +725,11 @@ static void set_termio_mode(void) { struct termios tio; + /* don't attempt to set terminal attributes if not in the foreground + * process group */ + if (getpgrp() != tcgetpgrp(STDOUT_FILENO)) + return; + tio_fd = dup(STDIN_FILENO); tcgetattr(tio_fd, &saved_tio); igt_install_exit_handler(restore_termio_mode); |