linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4l-utils] v4l2-compliance: flush stdout before calling fork()
@ 2018-11-01 17:46 Guillaume Tucker
  0 siblings, 0 replies; only message in thread
From: Guillaume Tucker @ 2018-11-01 17:46 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, kernel, Ezequiel Garcia, Guillaume Tucker

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 <guillaume.tucker@collabora.com>
---
 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);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-02  2:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 17:46 [PATCH v4l-utils] v4l2-compliance: flush stdout before calling fork() Guillaume Tucker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).