]> granicus.if.org Git - strace/commitdiff
tests/file_ioctl.c: use tail_alloc
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 24 May 2016 01:29:49 +0000 (01:29 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 24 May 2016 14:52:27 +0000 (14:52 +0000)
* tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc.

tests/file_ioctl.c

index e8950dfa82705295793be187249a52756091dfc9..0fb4affdd0a341134f5aa3ab8e49365a17261ae6 100644 (file)
 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");
 }