From: Bruno Haible <bruno@clisp.org>
Date: Sat, 17 Jan 2009 15:39:41 +0000 (+0100)
Subject: Avoid test-fflush2.sh failure on mingw.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ce0c024d8f5f537b8c1b2509c615af1ea430537;p=pspp

Avoid test-fflush2.sh failure on mingw.
---

diff --git a/ChangeLog b/ChangeLog
index 0feaefc1d0..9a2c3fc388 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-17  Bruno Haible  <bruno@clisp.org>
+
+	Avoid test-fflush2.sh failure on mingw.
+	* tests/test-fflush2.c: Include binary-io.h.
+	(main): Put standard input into binary mode.
+	* modules/fflush-tests (Depends-on): Add binary-io.
+
 2009-01-17  Bruno Haible  <bruno@clisp.org>
 
 	* lib/wchar.in.h: In another particular situation, include only the
diff --git a/modules/fflush-tests b/modules/fflush-tests
index d7ed9b1b66..da29805b88 100644
--- a/modules/fflush-tests
+++ b/modules/fflush-tests
@@ -4,6 +4,7 @@ tests/test-fflush2.sh
 tests/test-fflush2.c
 
 Depends-on:
+binary-io
 fseeko
 
 configure.ac:
diff --git a/tests/test-fflush2.c b/tests/test-fflush2.c
index 5ec1e55048..a395c6dbad 100644
--- a/tests/test-fflush2.c
+++ b/tests/test-fflush2.c
@@ -20,6 +20,8 @@
 
 #include <stdlib.h>
 
+#include "binary-io.h"
+
 #define ASSERT(expr) \
   do									     \
     {									     \
@@ -37,6 +39,10 @@ main (int argc, char **argv)
 {
   int c;
 
+  /* Avoid the well-known bugs of fflush() on streams in O_TEXT mode
+     on native Windows platforms.  */
+  SET_BINARY (0);
+
   if (argc > 1)
     switch (argv[1][0])
       {