bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pipe-filter-gi: Fix test failure on native Windows


From: Bruno Haible
Subject: pipe-filter-gi: Fix test failure on native Windows
Date: Sun, 11 Sep 2022 02:53:26 +0200

In a testdir of nearly all of gnulib, I see a test failure:

  FAIL: test-pipe-filter-gi2.sh

The logs reveal that the test-pipe-filter-gi2 test 3 fails, with status 141.
141 being 128 + SIGPIPE, the suspicion falls on the 'sigpipe' module. And
indeed, the failure occurs only if the modules 'sigpipe' and 'write' are
included in the testdir.

This patch fixes the problem, by side-stepping the write() override in
write.c.


2022-09-10  Bruno Haible  <bruno@clisp.org>

        pipe-filter-gi: Fix test failure on native Windows.
        * lib/pipe-filter-aux.h (write): Redefine on native Windows.

diff --git a/lib/pipe-filter-aux.h b/lib/pipe-filter-aux.h
index cda8ff7c34..df7dac6321 100644
--- a/lib/pipe-filter-aux.h
+++ b/lib/pipe-filter-aux.h
@@ -23,6 +23,17 @@ _GL_INLINE_HEADER_BEGIN
 # define PIPE_FILTER_AUX_INLINE _GL_INLINE
 #endif
 
+#if defined _WIN32 && ! defined __CYGWIN__
+/* In the pipe-filter-* modules we want to use the write() function that is
+   not overridden to emulate SIGPIPE behaviour, because we don't want force
+   the caller to do
+     signal (SIGPIPE, SIG_DFL);
+   To reproduce the problem, use a gnulib testdir for the modules
+   'pipe-filter-gi', 'write', 'sigpipe'.  */
+# undef write
+# define write _write
+#endif
+
 #ifndef SSIZE_MAX
 # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
 #endif






reply via email to

[Prev in Thread] Current Thread [Next in Thread]