Avoid test-fflush2.sh failure on mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 17 Jan 2009 15:39:41 +0000 (16:39 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 17 Jan 2009 15:39:41 +0000 (16:39 +0100)
ChangeLog
modules/fflush-tests
tests/test-fflush2.c

index 0feaefc1d053e87ec061b484049f346a570d5ebc..9a2c3fc3883b93b7cb585486ff2ab48dc70ac7b6 100644 (file)
--- 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
index d7ed9b1b66285a40361c6e0730d87e9b6d044ab0..da29805b884900092ca1e39935de8d2247943bf2 100644 (file)
@@ -4,6 +4,7 @@ tests/test-fflush2.sh
 tests/test-fflush2.c
 
 Depends-on:
+binary-io
 fseeko
 
 configure.ac:
index 5ec1e55048f859ec6a03226018f9def3139ae820..a395c6dbad14ff02c23edc8cb4c460beeed3a106 100644 (file)
@@ -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])
       {