avoid reopening stdin

This adjusts the change made in 3a8e165a,
to not reopen stdin on platforms where there
is no separate "binary mode".

That added some overhead and also precludes the
use of tools like `stdbuf -i...`.

* execute.c (open_next_file): Only reopen stdin on windos.
This commit is contained in:
Pádraig Brady authored and Paolo Bonzini committed 2011-07-04 12:45:19 +02:00
1 parent 607d56e084
commit 629ef76a75
4 files changed
+10 -1

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
2011-07-14 Padraig Brady <p@draigbrady.com>
* execute.c (open_next_file): Only reopen stdin on Windows/DOS.
2011-05-27 Paolo Bonzini <bonzini@gnu.org>
* doc/sed-in.texi: Explain behavior of \l and \u at the end
+1
View File
@@ -36,6 +36,7 @@ Maciej W. Rozycki <macro@linux-mips.org>
Mark Kettenis <kettenis@phys.uva.nl>
Michael De La Rue <delarue@NTCCSC01WA.ntc.nokia.com>
Michel de Ruiter <mdruiter@cs.vu.nl>
Padraig Brady <p@draigbrady.com>
Paul Eggert <eggert@twinsun.com>
Randall Cotton <recotton@earthlink.net>
Robert A Bruce <rab@allspice.berkeley.edu>
+1 -1
Submodule gnulib updated: afc6cbe4fe...79aac72351.
+4
View File
@@ -701,7 +701,11 @@ open_next_file(name, input)
if (name[0] == '-' && name[1] == '\0' && !in_place_extension)
{
clearerr(stdin); /* clear any stale EOF indication */
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
input->fp = ck_fdopen (fileno (stdin), "stdin", read_mode, false);
#else
input->fp = stdin;
#endif
}
else if ( ! (input->fp = ck_fopen(name, read_mode, false)) )
{