From 739097e6e145afb98057846c419c60c2cc2dd9c0 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 30 May 2008 22:58:37 +0200 Subject: [PATCH] Fixup posix_fallocate() usage It returns the error directly, not through errno. Also make it non-fatal, Solaris seems to complain about it. Signed-off-by: Jens Axboe --- filesetup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/filesetup.c b/filesetup.c index d57a3277..60eaeb05 100644 --- a/filesetup.c +++ b/filesetup.c @@ -70,10 +70,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f) dprint(FD_FILE, "fallocate file %s, size %llu\n", f->file_name, f->real_file_size); - if (posix_fallocate(f->fd, 0, f->real_file_size) < 0) { - td_verror(td, errno, "posix_fallocate"); - goto err; - } + r = posix_fallocate(f->fd, 0, f->real_file_size); + if (r < 0) + td_verror(td, -r, "posix_fallocate"); b = malloc(td->o.max_bs[DDIR_WRITE]); memset(b, 0, td->o.max_bs[DDIR_WRITE]); -- 2.25.1