summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-09 01:26:18 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-09 01:26:18 +0100
commitde954149f81f7f4f8df3e612382e8ba0541596cd (patch)
treebdaf97d775eb816e7acfeab1d27c96e43c20222f
parentd7ae295931962ad4150aeef4d55b5bffebdca87c (diff)
downloadsubunit-git-de954149f81f7f4f8df3e612382e8ba0541596cd.tar.gz
Force flush of writes to stdout in c/tests/test_child.
-rw-r--r--NEWS1
-rw-r--r--c/tests/test_child.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index f1fd9ce..31374d5 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ IMPROVEMENTS
per ``testtools.run``. This required a dependency bump due to a small
API change in ``testtools``. (Robert Collins)
+* Force flush of writes to stdout in c/tests/test_child. (Jelmer Vernooij, #687611)
0.0.6
-----
diff --git a/c/tests/test_child.c b/c/tests/test_child.c
index 0744599..1318322 100644
--- a/c/tests/test_child.c
+++ b/c/tests/test_child.c
@@ -16,6 +16,7 @@
**/
#include <stdlib.h>
+#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <check.h>
@@ -57,6 +58,8 @@ test_stdout_function(char const * expected,
* DEAL.
*/
function();
+ /* flush writes on FILE object to file descriptor */
+ fflush(stdout);
/* restore stdout now */
if (dup2(old_stdout, 1) != 1) {
close(old_stdout);