X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Fsync.c;h=ad02e09464f1935de33dc4a726ecef4edc3a8db8;hp=6a5b7d391ed206a465f8b2d1cbd7fcf550305c8f;hb=0be06ea2c87ecf1751a01ed528a2d3170bdca543;hpb=36167d82e5f49dee91c6d2cd426068edee90e36f diff --git a/engines/sync.c b/engines/sync.c index 6a5b7d39..ad02e094 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -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; }