Fix closeall for portability.
This commit is contained in:
parent
110bdc6b3e
commit
3c755f73f4
5
run.c
5
run.c
@ -1858,9 +1858,8 @@ void closeall(void)
|
|||||||
continue;
|
continue;
|
||||||
if (ferror(files[i].fp))
|
if (ferror(files[i].fp))
|
||||||
FATAL("i/o error occurred on %s", files[i].fname);
|
FATAL("i/o error occurred on %s", files[i].fname);
|
||||||
if (i == 0)
|
|
||||||
stat = fpurge(files[i].fp) == EOF;
|
if (i > 0 && i < 3)
|
||||||
else if (i <= 2)
|
|
||||||
stat = fflush(files[i].fp) == EOF;
|
stat = fflush(files[i].fp) == EOF;
|
||||||
else if (files[i].mode == '|' || files[i].mode == LE)
|
else if (files[i].mode == '|' || files[i].mode == LE)
|
||||||
stat = pclose(files[i].fp) == -1;
|
stat = pclose(files[i].fp) == -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user