Add new tst_flush() library function

Add a new library function to flush stderr and stdout streams:
void tst_flush(void)

This function flushes stderr and stdout streams. In case of an
error, the test is aborted with TBROK and an error message is
printed.

Signed-off-by: Michael Moese <mmoese@suse.de>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 2cf35ed..9b4f438 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1085,3 +1085,18 @@
 
 	do_exit(ret);
 }
+
+
+void tst_flush(void)
+{
+	int rval;
+
+	rval = fflush(stderr);
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO, "fflush(stderr) failed");
+
+	rval = fflush(stderr);
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO, "fflush(stdout) failed");
+
+}