From: Thomas Wood Subject: [PATCH i-g-t 3/4] lib: ensure any buffers are flushed before fork Date: Mon, 29 Sep 2014 16:28:17 +0100 Message-ID: <1412004498-8449-3-git-send-email-thomas.wood@intel.com> References: <1412004498-8449-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-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) In-Reply-To: <1412004498-8449-1-git-send-email-thomas.wood@intel.com> 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 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); -- 2.1.0