Fixup posix_fallocate() usage
[fio.git] / filesetup.c
index d57a3277563c3a45c13943dcc00da0d501e03a22..60eaeb057a7e0a144ee27fccd1b1f2da49fbe0ac 100644 (file)
@@ -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]);