From: Bruno Haible Date: Tue, 17 Dec 2024 17:21:03 +0000 (+0100) Subject: xstdopen: Improve error message. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3025740d099d3d58418a7d6972f9d41973f5f74a;p=gnulib.git xstdopen: Improve error message. * lib/xstdopen.c (xstdopen): Improve error message. Ignore the errno value. --- diff --git a/ChangeLog b/ChangeLog index 2ec6b3b487..fd3e2389d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-12-17 Bruno Haible + + xstdopen: Improve error message. + * lib/xstdopen.c (xstdopen): Improve error message. Ignore the errno + value. + 2024-12-10 Bruno Haible openat-die: Fix a gcc -Wformat -Wformat-security warning. diff --git a/lib/xstdopen.c b/lib/xstdopen.c index 3d15c261c5..2c691f5912 100644 --- a/lib/xstdopen.c +++ b/lib/xstdopen.c @@ -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"); }