diff --git a/common/ioall.c b/common/ioall.c index 1fca6f12..413477fc 100644 --- a/common/ioall.c +++ b/common/ioall.c @@ -23,6 +23,7 @@ #include #include #include +#include int write_all(int fd, void *buf, int size) { @@ -47,6 +48,7 @@ int read_all(int fd, void *buf, int size) while (got_read < size) { ret = read(fd, (char *) buf + got_read, size - got_read); if (ret == 0) { + errno = 0; fprintf(stderr, "EOF\n"); return 0; }