From 71b84caab6ef5ddbc7893e3268887b8ff0516f75 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 14 Apr 2014 12:01:45 -0600 Subject: [PATCH] td_verror() needs errno style error put_file_log() could pass in -1, we need the actual error instead. Signed-off-by: Jens Axboe --- filesetup.c | 5 ++++- io_u.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/filesetup.c b/filesetup.c index c132c326..38ccf31d 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1326,8 +1326,11 @@ int put_file(struct thread_data *td, struct fio_file *f) if (--f->references) return 0; - if (should_fsync(td) && td->o.fsync_on_close) + if (should_fsync(td) && td->o.fsync_on_close) { f_ret = fsync(f->fd); + if (f_ret < 0) + f_ret = errno; + } if (td->io_ops->close_file) ret = td->io_ops->close_file(td, f); diff --git a/io_u.c b/io_u.c index 411da324..4b0b5a7a 100644 --- a/io_u.c +++ b/io_u.c @@ -678,7 +678,7 @@ static void set_rw_ddir(struct thread_data *td, struct io_u *io_u) void put_file_log(struct thread_data *td, struct fio_file *f) { - int ret = put_file(td, f); + unsigned int ret = put_file(td, f); if (ret) td_verror(td, ret, "file close"); -- 2.25.1