diff --git a/src/common/remoteio.c b/src/common/remoteio.c --- a/src/common/remoteio.c +++ b/src/common/remoteio.c @@ -648,6 +648,7 @@ int _remoteio_sock_read(struct remoteio { ssize_t readrtn; + *bytesread = 0; readrtn = read(rem->sock, buf, len); /* The following is valid for blocking sockets: @@ -661,7 +662,6 @@ int _remoteio_sock_read(struct remoteio Some of these are not error conditions: */ perror("read"); - *bytesread = 0; if(errno != EINTR) {