diff --git a/src/iperf_api.c b/src/iperf_api.c index 6d6ee84..563aa76 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -4657,6 +4657,10 @@ diskfile_send(struct iperf_stream *sp) } r = read(sp->diskfile_fd, sp->buffer, sp->test->settings->blksize - sp->diskfile_left); + if (r <= 0) { + iperf_err(sp->test, "read failed again %d errno %d\n", r, errno); + return -1; + } } if (r < 0) { iperf_err(sp->test, "read failed with %d\n", errno);