]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
mach: Fix incoherency between perror and strerror
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 27 Aug 2022 11:52:46 +0000 (13:52 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 27 Aug 2022 12:36:18 +0000 (14:36 +0200)
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

sysdeps/mach/_strerror.c

index b179c440d3c3797eed1e5cb6e8a669daf44631ca..acc00612bb3ff2aa260aea3e5073ea22eed17bd3 100644 (file)
@@ -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;
     }