public inbox for
help / color / mirror / Atom feed
* [glibc] mach: Fix incoherency between perror and strerror
@ 2022-08-27 13:48 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2022-08-27 13:48 UTC (permalink / raw)
  To: glibc-cvs;h=03ad444e8e086391f53d87c3949e0d44adef4bc3

commit 03ad444e8e086391f53d87c3949e0d44adef4bc3
Author: Samuel Thibault <>
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

 sysdeps/mach/_strerror.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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: "),
       return buf;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-27 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27 13:48 [glibc] mach: Fix incoherency between perror and strerror Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).