diff mbox series

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

Message ID 20180309141609.2596-3-mmoese@suse.de
State Accepted
Headers show
Series [v3,1/3] remove old tst_flush() | expand

Commit Message

Michael Moese March 9, 2018, 2:16 p.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(-)

Comments

Cyril Hrubis March 13, 2018, 10:12 a.m. UTC | #1
Hi!
Pushed, thanks.
diff mbox series

Patch

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)