public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] mach: Fix incoherency between perror and strerror
Date: Sat, 27 Aug 2022 13:48:16 +0000 (GMT)	[thread overview]
Message-ID: <20220827134816.15DC3388DD20@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=03ad444e8e086391f53d87c3949e0d44adef4bc3

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

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

                 reply	other threads:[~2022-08-27 13:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220827134816.15DC3388DD20@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).