bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* pipe-filter-gi: Fix test failure on native Windows
@ 2022-09-11  0:53 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2022-09-11  0:53 UTC (permalink / raw
  To: bug-gnulib

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





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-11  0:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-11  0:53 pipe-filter-gi: Fix test failure on native Windows Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).