From patchwork Thu Nov 1 17:46:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 10664407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C96614E2 for ; Thu, 1 Nov 2018 17:48:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89FE12C238 for ; Thu, 1 Nov 2018 17:48:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 796CD2C25F; Thu, 1 Nov 2018 17:48:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AC932C238 for ; Thu, 1 Nov 2018 17:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727836AbeKBCwQ (ORCPT ); Thu, 1 Nov 2018 22:52:16 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:57954 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbeKBCwQ (ORCPT ); Thu, 1 Nov 2018 22:52:16 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id E4EF9260C9D From: Guillaume Tucker To: Hans Verkuil Cc: linux-media@vger.kernel.org, kernel@collabora.com, Ezequiel Garcia , Guillaume Tucker Subject: [PATCH v4l-utils] v4l2-compliance: flush stdout before calling fork() Date: Thu, 1 Nov 2018 17:46:35 +0000 Message-Id: X-Mailer: git-send-email 2.11.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to avoid corrupt log output, flush stdout before calling fork() when running streaming tests. This is to prevent any remaining characters in the stdout buffer from being output both in the parent and child process. Signed-off-by: Guillaume Tucker --- utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 6864f924daec..ee05739a2f73 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -1204,6 +1204,7 @@ static int testBlockingDQBuf(struct node *node, cv4l_queue &q) * This test checks if a blocking wait in VIDIOC_DQBUF doesn't block * other ioctls. */ + fflush(stdout); pid_dqbuf = fork(); fail_on_test(pid_dqbuf == -1); @@ -1224,6 +1225,7 @@ static int testBlockingDQBuf(struct node *node, cv4l_queue &q) /* Check that it is really blocking */ fail_on_test(pid); + fflush(stdout); pid_streamoff = fork(); fail_on_test(pid_streamoff == -1);