]> Savannah Git Hosting - gnulib.git/commitdiff
execute tests: Avoid test failure on Android.
authorBruno Haible <bruno@clisp.org>
Tue, 17 Jan 2023 14:15:57 +0000 (15:15 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 20 Jan 2023 10:18:58 +0000 (11:18 +0100)
* tests/test-execute-main.c (main): Reset the SIGPIPE handler to
default.

ChangeLog
tests/test-execute-main.c

index 7973ab46af2f47ab52ddccdc4dbed3755b0ae077..bb9f495f47fadc6c9422dfa712830bdbcc4d4222 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-17  Bruno Haible  <bruno@clisp.org>
+
+       execute tests: Avoid test failure on Android.
+       * tests/test-execute-main.c (main): Reset the SIGPIPE handler to
+       default.
+
 2023-01-15  Bruno Haible  <bruno@clisp.org>
 
        fpending: Fix compilation error with NDK ≥ r14b and Android API < 23.
index d89b34465b68d13ccb37dea4e3a5bed1476d733e..fbaa9c9d2e75bacbe97a6ac7693db1d96bcf3bda 100644 (file)
@@ -58,6 +58,18 @@ main (int argc, char *argv[])
   const char *progname = "test-execute-child";
   int test = atoi (argv[2]);
 
+#if defined __ANDROID__
+  /* On Android 11, when this test is executed through 'make' (GNU make 4.4) and
+     build-aux/test-driver, i.e. through
+       make check TESTS=test-execute.sh
+     or
+       rm -f test-execute.sh.log; make test-execute.sh.log
+     the signal handler for SIGPIPE is set to SIG_IGN.  This causes the tests
+     3 and 4 to fail.  Work around it by resetting the signal handler for
+     SIGPIPE to the default.  */
+  signal (SIGPIPE, SIG_DFL);
+#endif
+
   switch (test)
     {
     case 14: