diff mbox series

[v2,3/3] safe_fork() should use tst_flush() instead of fflush()

Message ID 20180309092701.8161-3-mmoese@suse.de
State Superseded
Headers show
Series [v2,1/3] Add tst_flush() library function | expand

Commit Message

Michael Moese March 9, 2018, 9:27 a.m. UTC
safe_fork() should not use fflush(stdout). This commit makes use of
the the newly added tst_flush(), which flushes, in fact, both stdout
and stderr.
In addition, tests output their results to stderr, so flushing stdout
here is simply wrong.

Signed-off-by: Michael Moese <mmoese@suse.de>
 lib/tst_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/lib/tst_test.c b/lib/tst_test.c
index 9b4f43828..7069bbc5e 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -380,7 +380,7 @@  pid_t safe_fork(const char *filename, unsigned int lineno)
 	if (!tst_test->forks_child)
 		tst_brk(TBROK, "test.forks_child must be set!");
-	fflush(stdout);
+	tst_flush();
 	pid = fork();
 	if (pid < 0)