X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=38ccf31dfea99fb91a48055db640400c1c25db9e;hp=c132c326e33afe5766cb2fbe15e1d031b8a30fa3;hb=71b84caab6ef5ddbc7893e3268887b8ff0516f75;hpb=66f7a56f70e40e9e953c47fae3a3432e87cd0cb7 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);