summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2016-05-24 01:29:49 +0000
committerDmitry V. Levin <ldv@altlinux.org>2016-05-24 14:52:27 +0000
commitaab00c2023832b879e275a444abb8182269a189c (patch)
tree02c9e96f8636d33fe8f6188731ac7d7807f90afa
parent3b730d4a0f080db318acc80cbea6e4a3aceb6def (diff)
downloadstrace-aab00c2023832b879e275a444abb8182269a189c.tar.gz
tests/file_ioctl.c: use tail_alloc
* tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc.
-rw-r--r--tests/file_ioctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/file_ioctl.c b/tests/file_ioctl.c
index e8950dfa8..0fb4affdd 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");
}