]> 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:06:10 +0000 (03:06 +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 db92a192b347101abdc93e887d7f56acedd69f07..2fcdda69017ec4409891e1d2a8a8212f96e80fcc 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 f9f7884deb77b6714ae555dd2ae1801389755ad6..684d907de51357e8f51de58f65f39204673fbf92 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 09d0f55412540b63fd8ad995c7fd7f8fb4ee5134..e0f97e4c0c85eba2bd4cb5d07de18b16e356a5f6 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;