Fix errval variable to be positive errno value
authorTomohiro Kusumi <tkusumi@tuxera.com>
Mon, 13 Mar 2017 18:15:01 +0000 (20:15 +0200)
committerJens Axboe <axboe@fb.com>
Mon, 13 Mar 2017 18:27:31 +0000 (12:27 -0600)
The local variable errval is used for strerror(3) which only works
with positive values (i.e. -EXXX doesn't return an expected string).

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c

index b04fb3e9b89362d1012883f594d9e6c7943e9fb3..f2e47b126e18a1127415e32dbca3d402497d19e0 100644 (file)
@@ -447,7 +447,7 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
                        f->file_name);
                ret = td->io_ops->invalidate(td, f);
                if (ret < 0)
-                       errval = ret;
+                       errval = -ret;
        } else if (f->filetype == FIO_TYPE_FILE) {
                dprint(FD_IO, "declare unneeded cache %s: %llu/%llu\n",
                        f->file_name, off, len);