]> Savannah Git Hosting - gnulib.git/commitdiff
pipe-filter-gi tests: Fix long-standing failure on native Windows.
authorBruno Haible <bruno@clisp.org>
Tue, 6 Sep 2022 13:09:41 +0000 (15:09 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 10 Sep 2022 01:03:03 +0000 (03:03 +0200)
* tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.

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

index e4932781906fa317ee4361f9519528b2ab79eea1..7f74fbea7c7dd8560dea8e926bf39614210ce4f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-09  Bruno Haible  <bruno@clisp.org>
+
+       pipe-filter-gi tests: Fix long-standing failure on native Windows.
+       * tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
+       (main): Avoid NL to CRLF conversion on standard output.
+       * tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
+       (main): Avoid NL to CRLF conversion on standard output.
+
 2022-09-09  Bruno Haible  <bruno@clisp.org>
 
        posix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.
index 0620b5331f98b3ce15fd9f26439aa9fac338ec43..e35ec2d67dfd690b9760f1270882e6093929b9f8 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 d772afc304f18d538c7d1c4b8f2a2e05beb5d863..d7c2e262546c1a6239f236ed9087b42436f39e3a 100644 (file)
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <signal.h>
 
+#include "binary-io.h"
 #include "full-write.h"
 #include "macros.h"
 
@@ -74,6 +75,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.  */
   {
     int rc;