exit on eof

This commit is contained in:
rsc 2005-01-05 04:01:12 +00:00
parent 33adad7dc7
commit f8104b3d3d

View file

@ -443,10 +443,8 @@ stdoutproc(void *v)
/* Let typing have a go -- maybe there's a rubout waiting. */
yield();
n = read(fd1, buf+npart, 8192);
if(n < 0)
if(n <= 0)
error(nil);
if(n == 0)
continue;
/* squash NULs */
s = memchr(buf+npart, 0, n);