1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 03:12:48 +02:00

(main): Ignore fd_reopen return value when ignoring input, since

we've closed input at that point so we are ignoring input.
This commit is contained in:
Paul Eggert
2006-03-23 23:56:34 +00:00
parent 7a88cb696f
commit 195689e7c7

View File

@@ -112,8 +112,8 @@ main (int argc, char **argv)
to ensure any read evokes an error. */
if (ignoring_input)
{
if (0 <= fd_reopen (STDIN_FILENO, "/dev/null", O_WRONLY, 0)
&& !redirecting_stdout && !redirecting_stderr)
fd_reopen (STDIN_FILENO, "/dev/null", O_WRONLY, 0);
if (!redirecting_stdout && !redirecting_stderr)
error (0, 0, _("ignoring input"));
}