A testdir for module 'execute' fails to compile on mingw:
../../gltests/test-execute-main.c: In function ‘main’:
../../gltests/test-execute-main.c:70:11: error: ‘SIGPIPE’ undeclared (first use
in this function); did you mean ‘SIGFPE’?
70 | signal (SIGPIPE, SIG_DFL);
| ^~~~~~~
This patch fixes it.
2023-04-20 Bruno Haible <[email protected]>
execute tests: Fix compilation error on mingw (regression 2023-01-17).
* tests/test-execute-main.c (main): Don't use SIGPIPE if it's not
defined.
diff --git a/tests/test-execute-main.c b/tests/test-execute-main.c
index 2088408756..cb799cf883 100644
--- a/tests/test-execute-main.c
+++ b/tests/test-execute-main.c
@@ -67,7 +67,9 @@ main (int argc, char *argv[])
GNU make 4.4: <https://savannah.gnu.org/bugs/index.php?63307>.
It causes the tests 3 and 4 to fail. Work around it by resetting
the signal handler for SIGPIPE to the default. */
+ #ifdef SIGPIPE
signal (SIGPIPE, SIG_DFL);
+ #endif
switch (test)
{