posixaio engine: residual data count
[fio.git] / engines / sync.c
index 6a5b7d391ed206a465f8b2d1cbd7fcf550305c8f..ad02e09464f1935de33dc4a726ecef4edc3a8db8 100644 (file)
@@ -21,7 +21,7 @@ static int fio_syncio_prep(struct thread_data *td, struct io_u *io_u)
                return 0;
 
        if (lseek(f->fd, io_u->offset, SEEK_SET) == -1) {
-               td_verror(td, errno);
+               td_verror(td, errno, "lseek");
                return 1;
        }
 
@@ -41,7 +41,7 @@ static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u)
                ret = fsync(f->fd);
 
        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;
@@ -50,7 +50,7 @@ static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u)
        }
 
        if (io_u->error)
-               td_verror(td, io_u->error);
+               td_verror(td, io_u->error, "xfer");
 
        return FIO_Q_COMPLETED;
 }