about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-12-27 21:22:14 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-12-27 21:23:05 +0100
commit422e4cd0ffbd71456cbefcf8027c866638c7124f (patch)
tree78e4193a05020f3b6ef6953c053e35176c5c4aab /stdio-common
parentcca457f9c51a90cf82cae75432ed3de20942519c (diff)
downloadglibc-422e4cd0ffbd71456cbefcf8027c866638c7124f.tar.gz
glibc-422e4cd0ffbd71456cbefcf8027c866638c7124f.tar.xz
glibc-422e4cd0ffbd71456cbefcf8027c866638c7124f.zip
stdio-common: Fix %m sprintf test output for GNU/Hurd
GNU/Hurd has slightly different error messages for undefined numbers,
due to the notion of error subsystems.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/tst-sprintf-errno.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c
index 7622fdbc48..f5b587f0fe 100644
--- a/stdio-common/tst-sprintf-errno.c
+++ b/stdio-common/tst-sprintf-errno.c
@@ -48,16 +48,26 @@ do_test (void)
   TEST_COMPARE_STRING (buf, "0");
 
   errno = -1;
+#ifdef __GNU__
+  TEST_COMPARE (sprintf (buf, "%m"), 35);
+  TEST_COMPARE_STRING (buf, "Error in unknown error system: : -1");
+#else
   TEST_COMPARE (sprintf (buf, "%m"), 16);
   TEST_COMPARE_STRING (buf, "Unknown error -1");
+#endif
 
   errno = -1;
   TEST_COMPARE (sprintf (buf, "%#m"), 2);
   TEST_COMPARE_STRING (buf, "-1");
 
   errno = 1002003;
+#ifdef __GNU__
+  TEST_COMPARE (sprintf (buf, "%m"), 42);
+  TEST_COMPARE_STRING (buf, "(system kern) error with unknown subsystem");
+#else
   TEST_COMPARE (sprintf (buf, "%m"), 21);
   TEST_COMPARE_STRING (buf, "Unknown error 1002003");
+#endif
 
   errno = 1002003;
   TEST_COMPARE (sprintf (buf, "%#m"), 7);