net: exit on WAITALL and !ret
authorJens Axboe <axboe@kernel.dk>
Thu, 29 Nov 2012 18:57:35 +0000 (19:57 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Nov 2012 18:57:35 +0000 (19:57 +0100)
Otherwise we can loop forever if the other end hung up.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/net.c

index 101f7540789b9994a084777e02529e4be102429b..419508e47a5ec037a33c2c00781973820cbdc752 100644 (file)
@@ -360,6 +360,8 @@ static int fio_netio_recv(struct thread_data *td, struct io_u *io_u)
                }
                if (ret > 0)
                        break;
+               else if (!ret && (flags & MSG_WAITALL))
+                       break;
 
                ret = poll_wait(td, io_u->file->fd, POLLIN);
                if (ret <= 0)