[PATCH v4l-utils] v4l2-compliance: flush stdout before calling fork()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux