summaryrefslogtreecommitdiff
path: root/src/fiemap.h
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-07-15 09:51:35 +0100
committerPádraig Brady <P@draigBrady.com>2011-07-15 10:55:04 +0100
commit4f71710c420caa8d9efa93fb30c308976be0eda0 (patch)
treeae434a701e79c1f5446ff17643a7590f4937a5cf /src/fiemap.h
parentfeb0b08c0d030fbeb94ef4f7b6f7f701ffb42af5 (diff)
downloadcoreutils-4f71710c420caa8d9efa93fb30c308976be0eda0.tar.xz
build: avoid a fiemap compile failure on some systems
* src/fiemap.h (struct fiemap): Adjust the previous change to the fiemap_extents array, which would also require changes to the sizeof calculations in extent_scan_read(). Instead, only declare the fiemap_extents zero length array on linux, which is the only platform that references this member. This avoids a compilation failure on systems that don't support this non standard construct. We don't use the equivalent C99 flexible array construct so as to have maximum portability. * src/extent-scan.c: Cleanup. Remove a redundant #ifndef.
Diffstat (limited to 'src/fiemap.h')
-rw-r--r--src/fiemap.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fiemap.h b/src/fiemap.h
index e7243b41b..15ddff9a0 100644
--- a/src/fiemap.h
+++ b/src/fiemap.h
@@ -52,8 +52,12 @@ struct fiemap
uint32_t fm_reserved;
/* Array of mapped extents(out).
- The actual size is given by fm_extent_count. */
- struct fiemap_extent fm_extents[1];
+ This is protected by the ifdef because it uses non standard
+ zero length arrays. Note C99 has the equivalent flexible arrays,
+ but we don't use those for maximum portability to older systems. */
+# ifdef __linux__
+ struct fiemap_extent fm_extents[0];
+# endif
};
/* The maximum offset can be mapped for a file. */