From: Greg Edwards Date: Fri, 25 Jun 2010 15:25:22 +0000 (-0600) Subject: fix posix_fallocate() return value usage X-Git-Tag: fio-1.41.6~5 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=10accd7cf68af21ef4831528626a75ba7a06ce81;p=fio.git 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 --- 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