From afd118db00aeaf5314d62edb99b4d3605d08e9c6 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Mon, 13 Mar 2017 20:15:01 +0200 Subject: [PATCH] Fix errval variable to be positive errno value 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 Signed-off-by: Jens Axboe --- filesetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index b04fb3e9..f2e47b12 100644 --- a/filesetup.c +++ b/filesetup.c @@ -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); -- 2.25.1