summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-05-30 22:58:37 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-05-30 22:58:37 +0200
commit739097e6e145afb98057846c419c60c2cc2dd9c0 (patch)
tree344bd27a9778fabdac160c612fd85ea63528603c
parentaf8771b9b91eb2cd23a40aaa729bad4f78acb928 (diff)
downloadfio-739097e6e145afb98057846c419c60c2cc2dd9c0.tar.gz
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 <jens.axboe@oracle.com>
-rw-r--r--filesetup.c7
1 files 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]);