net: fix error reported on job exit and full residual
[fio.git] / engines / net.c
index 1d89db1cdcecc4a740b1afe603711ea3a114ba0c..61bdfdd19be81a06fe1ae295b7898546f803de39 100644 (file)
@@ -515,11 +515,13 @@ static int __fio_netio_queue(struct thread_data *td, struct io_u *io_u,
                ret = 0;        /* must be a SYNC */
 
        if (ret != (int) io_u->xfer_buflen) {
-               if (ret >= 0) {
+               if (ret > 0) {
                        io_u->resid = io_u->xfer_buflen - ret;
                        io_u->error = 0;
                        return FIO_Q_COMPLETED;
-               } else {
+               } else if (!ret)
+                       return FIO_Q_BUSY;
+               else {
                        int err = errno;
 
                        if (ddir == DDIR_WRITE && err == EMSGSIZE)