X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=smalloc.c;h=42008ebfdb6e44732c469b596b7be65786031231;hp=4cd8298eaa004d7a56d861aefcb1373ae7fd7001;hb=8489dae4360f2b00d89a6e9603c6167314b1974d;hpb=3a8600b4ae9027d02aca7eb1990e5cda4e9f423a diff --git a/smalloc.c b/smalloc.c index 4cd8298e..42008ebf 100644 --- a/smalloc.c +++ b/smalloc.c @@ -178,7 +178,7 @@ static int find_next_zero(int word, int start) static int add_pool(struct pool *pool, unsigned int alloc_size) { - int fd, bitmap_blocks, ret; + int fd, bitmap_blocks; char file[] = "/tmp/.fio_smalloc.XXXXXX"; void *ptr; @@ -203,10 +203,14 @@ static int add_pool(struct pool *pool, unsigned int alloc_size) pool->free_blocks = bitmap_blocks * SMALLOC_BPB; #ifdef FIO_HAVE_FALLOCATE - ret = posix_fallocate(fd, 0, alloc_size); - if (ret > 0) { - fprintf(stderr, "posix_fallocate pool file failed: %s\n", strerror(ret)); - goto out_unlink; + { + int ret; + + ret = posix_fallocate(fd, 0, alloc_size); + if (ret > 0) { + fprintf(stderr, "posix_fallocate pool file failed: %s\n", strerror(ret)); + goto out_unlink; + } } #endif