From 10accd7cf68af21ef4831528626a75ba7a06ce81 Mon Sep 17 00:00:00 2001 From: Greg Edwards Date: Fri, 25 Jun 2010 09:25:22 -0600 Subject: [PATCH] fix posix_fallocate() return value usage posix_fallocate() returns the error number on failure. Fix the return value usage. Signed-off-by: Greg Edwards Signed-off-by: Jens Axboe --- filesetup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filesetup.c b/filesetup.c index b90d12ae..f0883901 100644 --- a/filesetup.c +++ b/filesetup.c @@ -71,9 +71,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f) f->real_file_size); r = posix_fallocate(f->fd, 0, f->real_file_size); - if (r < 0) { + if (r > 0) { log_err("fio: posix_fallocate fails: %s\n", - strerror(-r)); + strerror(r)); } } #endif -- 2.25.1