git-strerror_X
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 4 Oct 2022 05:07:58 +0000 (06:07 +0100)
committerAurelien Jarno <aurel32@debian.org>
Tue, 4 Oct 2022 05:07:58 +0000 (06:07 +0100)
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.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-strerror_X.diff

stdio-common/tst-sprintf-errno.c
sysdeps/mach/_strerror.c

index ca1214cde61b8e1f2c4e150f2a1ac9f4fd830c11..13e7ed28f0390e15fbbab580733e79a043965e23 100644 (file)
@@ -49,8 +49,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");
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;
     }