From: Bruno Haible <bruno@clisp.org>
Date: Sun, 25 Jun 2023 16:40:19 +0000 (+0200)
Subject: sigdescr_np tests: Avoid test failure on glibc/sparc.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cbd6fa86d390188843941a7738e65fe3ac907769;p=gnulib.git

sigdescr_np tests: Avoid test failure on glibc/sparc.

* tests/test-sigdescr_np.c (main): Accept the glibc result for SIGEMT.
* doc/glibc-functions/sigdescr_np.texi: Mention two glibc deficiencies.
---

diff --git a/ChangeLog b/ChangeLog
index 4134d895c8..c14a6dccf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-06-25  Bruno Haible  <bruno@clisp.org>
+
+	sigdescr_np tests: Avoid test failure on glibc/sparc.
+	* tests/test-sigdescr_np.c (main): Accept the glibc result for SIGEMT.
+	* doc/glibc-functions/sigdescr_np.texi: Mention two glibc deficiencies.
+
 2023-06-25  Bruno Haible  <bruno@clisp.org>
 
 	strerrorname_np: Work around glibc bug on PowerPC, SPARC systems.
diff --git a/doc/glibc-functions/sigdescr_np.texi b/doc/glibc-functions/sigdescr_np.texi
index 2bd2633b5d..123b162013 100644
--- a/doc/glibc-functions/sigdescr_np.texi
+++ b/doc/glibc-functions/sigdescr_np.texi
@@ -21,6 +21,12 @@ glibc 2.31, macOS 11.1, FreeBSD 13.0, NetBSD 9.0, OpenBSD 6.7, Minix 3.1.8, AIX
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+The description of SIGCHLD is wrong on some platforms:
+glibc.
+@item
+The description of SIGEMT is completely unintelligible on some platforms:
+glibc.
 @end itemize
 
 Note: This function is hardly useful, because it returns English strings, not
diff --git a/tests/test-sigdescr_np.c b/tests/test-sigdescr_np.c
index 243f4aac66..c816f6c64d 100644
--- a/tests/test-sigdescr_np.c
+++ b/tests/test-sigdescr_np.c
@@ -1,6 +1,6 @@
 /* Test of sigdescr_np() function.
 
-   Copyright (C) 2020-2022 Free Software Foundation, Inc.
+   Copyright (C) 2020-2023 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -126,9 +126,11 @@ main (void)
   #ifdef SIGDANGER
   ASSERT (strcmp (sigdescr_np (SIGDANGER), "Swap space nearly exhausted") == 0);
   #endif
-  /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, mingw */
+  /* glibc, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, mingw */
   #ifdef SIGEMT
-  ASSERT (strcmp (sigdescr_np (SIGEMT), "Instruction emulation needed") == 0);
+  ASSERT (strcmp (sigdescr_np (SIGEMT), "Instruction emulation needed") == 0
+          /* This completely unintelligible message is seen in glibc.  */
+          || strcmp (sigdescr_np (SIGEMT), "EMT trap") == 0);
   #endif
   /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
   #if defined SIGINFO && SIGINFO != SIGPWR