have compiler error out if read fails
This commit is contained in:
parent
2d288b4002
commit
9f31fa9d8e
1 changed files with 3 additions and 1 deletions
|
@ -1262,7 +1262,9 @@ loop:
|
|||
if(i->f < 0)
|
||||
goto pop;
|
||||
fi.c = read(i->f, i->b, BUFSIZ) - 1;
|
||||
if(fi.c < 0) {
|
||||
if(fi.c < -1)
|
||||
sysfatal("read error: %r");
|
||||
if(fi.c == -1) {
|
||||
close(i->f);
|
||||
linehist(0, 0);
|
||||
goto pop;
|
||||
|
|
Loading…
Reference in a new issue