diff options
-rw-r--r-- | src/libthread/fdwait.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libthread/fdwait.c b/src/libthread/fdwait.c index 5dd7e868..927fc64f 100644 --- a/src/libthread/fdwait.c +++ b/src/libthread/fdwait.c @@ -233,8 +233,9 @@ threadread(int fd, void *a, long n) threadfdnoblock(fd); again: + errno = 0; nn = read(fd, a, n); - if(nn < 0){ + if(nn <= 0){ if(errno == EINTR) goto again; if(errno == EAGAIN || errno == EWOULDBLOCK){ |