]> 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>
Wed, 25 Dec 2024 13:43:53 +0000 (14:43 +0100)
* lib/xstdopen.c (xstdopen): Improve error message. Ignore the errno
value.

ChangeLog
lib/xstdopen.c

index c2fdf3722f4dc41b57fe3ebc63fc980aa6f01fb4..61ba02f328ac619d250b0f4d885c4b2acbb15048 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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-10  Bruno Haible  <bruno@clisp.org>
 
        openat-die: Fix a gcc -Wformat -Wformat-security warning.
index 3d15c261c5ff1bd85c801addce3a75c7b8e9d6bd..2c691f591297f977b27af8f47790416b2c064fdd 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");
 }