From: Thomas Wood Subject: [PATCH i-g-t] testdisplay: only set terminal attributes when in foreground process group Date: Fri, 25 Jul 2014 11:46:36 +0100 Message-ID: <1406285196-4234-1-git-send-email-thomas.wood@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by gabe.freedesktop.org (Postfix) with ESMTP id A5D576E7F7 for ; Fri, 25 Jul 2014 03:46:43 -0700 (PDT) Received: by mail-we0-f169.google.com with SMTP id u56so4000571wes.14 for ; Fri, 25 Jul 2014 03:46:41 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 --- tests/testdisplay.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 6d8fe3a..f60e66d 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); -- 1.9.3