From aab00c2023832b879e275a444abb8182269a189c Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 24 May 2016 01:29:49 +0000 Subject: [PATCH] tests/file_ioctl.c: use tail_alloc * tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc. --- tests/file_ioctl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/file_ioctl.c b/tests/file_ioctl.c index e8950dfa..0fb4affd 100644 --- a/tests/file_ioctl.c +++ b/tests/file_ioctl.c @@ -12,13 +12,15 @@ static void test_fiemap(void) { - struct fiemap args = {}; + (void) tail_alloc(1); + struct fiemap *const args = tail_alloc(sizeof(*args)); + printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 ", fm_length=%" PRI__u64", fm_flags=", - args.fm_start, args.fm_length); - printflags(fiemap_flags, args.fm_flags, "FIEMAP_FLAG_???"); - printf(", fm_extent_count=%u})", args.fm_extent_count); - ioctl(-1, FS_IOC_FIEMAP, &args); + args->fm_start, args->fm_length); + printflags(fiemap_flags, args->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_extent_count=%u})", args->fm_extent_count); + ioctl(-1, FS_IOC_FIEMAP, args); printf(" = -1 EBADF (%m)\n"); } -- 2.40.0