1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
commit 03ad444e8e086391f53d87c3949e0d44adef4bc3
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat Aug 27 13:52:46 2022 +0200
mach: Fix incoherency between perror and strerror
08d2024b4167 ("string: Simplify strerror_r") inadvertently made
__strerror_r print unknown error system in decimal while the original
code was printing it in hexadecimal. perror was kept printing in
hexadecimal in 725eeb4af14c ("string: Use tls-internal on strerror_l"),
let us keep both coherent.
This also fixes a duplicate ':'
Spotted by the libunistring testsuite test-perror2
commit 1918241b55540536fee45b3096e786b7b7f9277a
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sun Sep 11 14:20:32 2022 +0200
tst-sprintf-errno: Update Hurd message output
03ad444e8e08 ("mach: Fix incoherency between perror and strerror")
fixesd the output of error messages, but tst-sprintf-errno.c was still
checking the old (erroneous) format. This updates the expected output
according to the 03ad444e8e08 fix.
diff --git a/sysdeps/mach/_strerror.c b/sysdeps/mach/_strerror.c
index b179c440d3..acc00612bb 100644
--- a/sysdeps/mach/_strerror.c
+++ b/sysdeps/mach/_strerror.c
@@ -40,7 +40,7 @@ __strerror_r (int errnum, char *buf, size_t buflen)
if (system > err_max_system || ! __mach_error_systems[system].bad_sub)
{
- __snprintf (buf, buflen, "%s: %d", _("Error in unknown error system: "),
+ __snprintf (buf, buflen, "%s%X", _("Error in unknown error system: "),
errnum);
return buf;
}
diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c
index ca1214cde6..91b1f142fb 100644
--- a/stdio-common/tst-sprintf-errno.c
+++ b/stdio-common/tst-sprintf-errno.c
@@ -50,8 +50,8 @@ do_test (void)
errno = -1;
#ifdef __GNU__
- TEST_COMPARE (sprintf (buf, "%m"), 35);
- TEST_COMPARE_STRING (buf, "Error in unknown error system: : -1");
+ TEST_COMPARE (sprintf (buf, "%m"), 39);
+ TEST_COMPARE_STRING (buf, "Error in unknown error system: FFFFFFFF");
#else
TEST_COMPARE (sprintf (buf, "%m"), 16);
TEST_COMPARE_STRING (buf, "Unknown error -1");
|