From patchwork Fri Jul 25 10:46:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 4622351 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E07309F375 for ; Fri, 25 Jul 2014 10:46:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E541201DC for ; Fri, 25 Jul 2014 10:46:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E8B5620173 for ; Fri, 25 Jul 2014 10:46:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DE2A6E7F6; Fri, 25 Jul 2014 03:46:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=ulEkoa3rz+j5oVLkOjFHtLF4DpBdKb78wFcfCkMSiA4=; b=l1AY78Fs9ZO90yNFJOQsdS9dPmzft6qylXAU5J1AwztOkdqtYTKbVmVaAQNEnSHkUG rHWK7b0pIYXwQHXVWzFl6xUY4hN2KT/o0yGcs08sYCk8C0St8AyH+Jaj/GTx96Ys8JZ6 VVQy5L8sW9aNqebeshSGxYHvfoljuKFTeEmPTvAZzCOTe2qR8TCdHAG73nzKd/VGWt8v webBZ52cBB7NBgvATRxNgWmZOGA/pkwn0CuOT0Kn2fS2uj9qMD07WdqSmycFTSyu0sh2 db2mJHzSSIQBl7Jo5gcs9NaCiD18O31LrqAyb0AfD5Q4oVV54wTqOiJtjCm1qH3HtbhV KCKQ== X-Gm-Message-State: ALoCoQlaC6TAWt0vcZpUBpcncM/MZIDlF5ML3tlSbvaBoW9MdbaJ3h8yVWDg8ZA1hgU79Lfv+ZqD X-Received: by 10.180.76.68 with SMTP id i4mr3850189wiw.83.1406285200606; Fri, 25 Jul 2014 03:46:40 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id u10sm4441168wix.14.2014.07.25.03.46.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jul 2014 03:46:39 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Fri, 25 Jul 2014 11:46:36 +0100 Message-Id: <1406285196-4234-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [Intel-gfx] [PATCH i-g-t] testdisplay: only set terminal attributes when in foreground process group X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);