td_verror() needs errno style error
authorJens Axboe <axboe@fb.com>
Mon, 14 Apr 2014 18:01:45 +0000 (12:01 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 14 Apr 2014 18:01:45 +0000 (12:01 -0600)
put_file_log() could pass in -1, we need the actual error instead.

Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c
io_u.c

index c132c326e33afe5766cb2fbe15e1d031b8a30fa3..38ccf31dfea99fb91a48055db640400c1c25db9e 100644 (file)
@@ -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 411da3249796987d698e475380824022dca6d12d..4b0b5a7a11bdb002f72d552c89ee4ce8c4fd6b4e 100644 (file)
--- 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");