When closing, don't flush input streams
They don't need it.
This commit is contained in:
parent
99f6a43296
commit
7816d47dc8
2
run.c
2
run.c
@ -1872,6 +1872,7 @@ Cell *closefile(Node **a, int n)
|
||||
for (i = 0; i < nfiles; i++) {
|
||||
if (!files[i].fname || strcmp(x->sval, files[i].fname) != 0)
|
||||
continue;
|
||||
if (files[i].mode == GT || files[i].mode == '|')
|
||||
fflush(files[i].fp);
|
||||
if (ferror(files[i].fp)) {
|
||||
if ((files[i].mode == GT && files[i].fp != stderr)
|
||||
@ -1909,6 +1910,7 @@ void closeall(void)
|
||||
for (i = 0; i < nfiles; i++) {
|
||||
if (! files[i].fp)
|
||||
continue;
|
||||
if (files[i].mode == GT || files[i].mode == '|')
|
||||
fflush(files[i].fp);
|
||||
if (ferror(files[i].fp)) {
|
||||
if ((files[i].mode == GT && files[i].fp != stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user