When closing, don't flush input streams

They don't need it.
master
Miguel Pineiro Jr 9 months ago
parent 99f6a43296
commit 7816d47dc8
  1. 6
      run.c

@ -1872,7 +1872,8 @@ Cell *closefile(Node **a, int n)
for (i = 0; i < nfiles; i++) {
if (!files[i].fname || strcmp(x->sval, files[i].fname) != 0)
continue;
fflush(files[i].fp);
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)
|| files[i].mode == '|')
@ -1909,7 +1910,8 @@ void closeall(void)
for (i = 0; i < nfiles; i++) {
if (! files[i].fp)
continue;
fflush(files[i].fp);
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)
|| files[i].mode == '|')

Loading…
Cancel
Save