about summary refs log tree commit diff
path: root/string/tst-strsignal.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-09 13:24:04 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-13 09:16:11 -0300
commit10b01bd4529336bffc2c398ce43a171ed94aacc7 (patch)
tree62ba252dd57aec8ac577d211783010ab89850ca1 /string/tst-strsignal.c
parente72b98e6f858583a3ef904e27c6fbd932bdc86c8 (diff)
downloadglibc-10b01bd4529336bffc2c398ce43a171ed94aacc7.tar.gz
glibc-10b01bd4529336bffc2c398ce43a171ed94aacc7.tar.xz
glibc-10b01bd4529336bffc2c398ce43a171ed94aacc7.zip
string: Make tst-strerror/tst-strsignal unsupported if msgfmt is not installed
Without msgfmt libc.mo files are not generated and its loading failure
is silent ignored with xsetlocale.

Also unset LANGUAGE environment variable to avoid it taking precedence
when loading the message catalog.  Although not strictly required
(since the test is issued with test-container and it sets a strict
environment variable) it follows other tests that deal with
translation.

Checked on x86_64-linux-gnu.
Diffstat (limited to 'string/tst-strsignal.c')
-rw-r--r--string/tst-strsignal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/string/tst-strsignal.c b/string/tst-strsignal.c
index 3f6764989f..2c549f4620 100644
--- a/string/tst-strsignal.c
+++ b/string/tst-strsignal.c
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <signal.h>
+#include <stdlib.h>
 #include <locale.h>
 #include <array_length.h>
 
@@ -29,6 +30,8 @@
 static int
 do_test (void)
 {
+  unsetenv ("LANGUAGE");
+
   xsetlocale (LC_ALL, "C");
 
   TEST_COMPARE_STRING (strsignal (SIGINT),     "Interrupt");