]> Savannah Git Hosting - gnulib.git/commitdiff
pipe-filter-ii tests: Fix long-standing failure on native Windows.
authorBruno Haible <bruno@clisp.org>
Tue, 15 Jun 2021 16:37:18 +0000 (18:37 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 15 Jun 2021 16:38:09 +0000 (18:38 +0200)
* tests/test-pipe-filter-ii2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-ii2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.

ChangeLog
tests/test-pipe-filter-ii2-child.c
tests/test-pipe-filter-ii2-main.c

index b192beba1419d34b26fca60089630f2b74b51b09..9e66bc23e696e19fd87dc481822f8d1b4e4b5575 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-06-15  Bruno Haible  <bruno@clisp.org>
+
+       pipe-filter-ii tests: Fix long-standing failure on native Windows.
+       * tests/test-pipe-filter-ii2-main.c: Include binary-io.h.
+       (main): Avoid NL to CRLF conversion on standard output.
+       * tests/test-pipe-filter-ii2-child.c: Include <unistd.h>, binary-io.h.
+       (main): Avoid NL to CRLF conversion on standard output.
+
 2021-06-15  Bruno Haible  <bruno@clisp.org>
 
        xnanosleep: Improve module description.
index 14c986378308ae60fa136fb4b0358612aa250b94..2610988ad38bb93cb1126dab7ea74bb061aa6834 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+
+#include "binary-io.h"
 
 int
 main ()
 {
+  set_binary_mode (STDOUT_FILENO, O_BINARY);
+
   /* Repeatedly: Read two integers i and j, then output all integers in the
      range i..j, one per line.  */
   for (;;)
index 3674e01ca5a6071bdca5f7e5858a1d4ce01d6701..aad05051982c535519da1724d0cb57a452700046 100644 (file)
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <signal.h>
 
+#include "binary-io.h"
 #include "full-write.h"
 #include "macros.h"
 
@@ -88,6 +89,8 @@ main (int argc, char **argv)
 
   ASSERT (argc == 2);
 
+  set_binary_mode (STDOUT_FILENO, O_BINARY);
+
   /* Test writing to a nonexistent program traps sooner or later.  */
   {
     struct locals l;