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 0feaefc..9a2c3fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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
        system's <wchar.h> file.
        (_GL_ALREADY_INCLUDING_WCHAR_H): New macro.
index d7ed9b1..da29805 100644 (file)
@@ -4,6 +4,7 @@ tests/test-fflush2.sh
 tests/test-fflush2.c
 
 Depends-on:
+binary-io
 fseeko
 
 configure.ac:
index 5ec1e55..a395c6d 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])
       {