From: Jens Axboe Date: Fri, 30 May 2008 20:58:37 +0000 (+0200) Subject: Fixup posix_fallocate() usage X-Git-Tag: fio-1.21-rc4~14 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=739097e6e145afb98057846c419c60c2cc2dd9c0;p=fio.git 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 --- 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]);