[PATCH i-g-t 3/4] lib: ensure any buffers are flushed before fork

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

 



Flush any buffers before forking to prevent duplicated output.

Signed-off-by: Thomas Wood <thomas.wood@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux