From patchwork Mon Sep 29 15:28:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 4997681 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31EACBEEA6 for ; Mon, 29 Sep 2014 15:47:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C09320173 for ; Mon, 29 Sep 2014 15:47:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A5D9420160 for ; Mon, 29 Sep 2014 15:47:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4575D73506; Mon, 29 Sep 2014 08:47:05 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by gabe.freedesktop.org (Postfix) with ESMTP id EB5EA72394 for ; Mon, 29 Sep 2014 08:28:23 -0700 (PDT) Received: by mail-we0-f170.google.com with SMTP id q58so3757463wes.1 for ; Mon, 29 Sep 2014 08:28:22 -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:in-reply-to :references; bh=j05GU1+IaqQ9GMHj7uLJEinwLbLN2qMde8l0kf0gUmY=; b=OOwKgoR5MnecD/X2ipCDofBN2Hav+5eVMdjvDxYkefG4t9jf8SyvaziLlhq81G6XUF qTbsBTGz+7yGueGf1EW6DUNdY5yu8lV/3KT8tJKnkcDwD9DNeILIKaFc+nqHuca1D8z2 sBZjx4Cc97rGIoEBcvED0j7Hhe94Zg9YwWdrXAuXE4MxtjK9gyJffMfp9ALH+urPPC/D 3bMKqt4xGIVug4Nm7LvYUOvyNz3wDFGdhzgRdHNZpcm6DX9qPtrYBem+TbssnWYrLVem yrjYkx9Uek+6YcObnlOjmG2mkS+Lc+hIt62705p27wwyeFy1JO8zoWortSzZwIdiDDkS LGFQ== X-Gm-Message-State: ALoCoQlqOayHCvcI4AVMqPGd1BWMMuR+6PCF1GWVJ4fEscuvmHiXk/cKBD0h5eZYBbTwBGsoYW3K X-Received: by 10.194.119.193 with SMTP id kw1mr45831653wjb.82.1412004502865; Mon, 29 Sep 2014 08:28:22 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ua8sm16089212wjc.7.2014.09.29.08.28.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Sep 2014 08:28:22 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Mon, 29 Sep 2014 16:28:17 +0100 Message-Id: <1412004498-8449-3-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412004498-8449-1-git-send-email-thomas.wood@intel.com> References: <1412004498-8449-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 3/4] lib: ensure any buffers are flushed before fork 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=-5.0 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 Flush any buffers before forking to prevent duplicated output. Signed-off-by: Thomas Wood --- lib/igt_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/igt_core.c b/lib/igt_core.c index f2b4560..6e1c51a 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -928,6 +928,10 @@ bool __igt_fork_helper(struct igt_helper_process *proc) */ tmp_count = exit_handler_count; exit_handler_count = 0; + + /* ensure any buffers are flushed before fork */ + fflush(NULL); + switch (pid = fork()) { case -1: exit_handler_count = tmp_count; @@ -1019,6 +1023,9 @@ bool __igt_fork(void) igt_assert(test_children); } + /* ensure any buffers are flushed before fork */ + fflush(NULL); + switch (test_children[num_test_children++] = fork()) { case -1: igt_assert(0);