]> Savannah Git Hosting - gnulib.git/commitdiff
xstdopen: Improve error message.
authorBruno Haible <bruno@clisp.org>
Tue, 17 Dec 2024 17:21:03 +0000 (18:21 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 17 Dec 2024 17:21:03 +0000 (18:21 +0100)
* lib/xstdopen.c (xstdopen): Improve error message. Ignore the errno
value.

ChangeLog
lib/xstdopen.c

index 6268ba9ce37e404a2a35c172aebfe49f2df869ca..0cf269fdb48f5f8280f07392f72d49cc75e4c306 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
+2024-12-17  Bruno Haible  <bruno@clisp.org>
+
+       xstdopen: Improve error message.
+       * lib/xstdopen.c (xstdopen): Improve error message. Ignore the errno
+       value.
+
 2024-12-16  Sam Russell  <sam.h.russell@gmail.com>
 
        crc: Add PCLMUL implementation
-
        * lib/crc-x86_64-pclmul.c: Implement CRC32 with PCLMUL intrinsics.
        * lib/crc-x86_64.h: Add header for CRC32 with PCLMUL instrinsics.
        * lib/crc.c: Use PCLMUL implementation if available.
index 678c2a9d9f98f1ae1e6a5f34472110ff432d3cd7..b82f44f0a8760d5968d032a7b9e1b378c69021f2 100644 (file)
@@ -31,5 +31,9 @@ xstdopen (void)
 {
   int stdopen_errno = stdopen ();
   if (stdopen_errno != 0)
-    error (exit_failure, stdopen_errno, _("standard file descriptors"));
+    /* Ignore stdopen_errno in the error message, since it may be misleading
+       (see stdopen.c).  */
+    error (exit_failure, 0,
+           _("failed to open all three standard file descriptors; maybe %s or %s are not working right?"),
+           "/dev/null", "/dev/full");
 }