From: Eric Sandeen Date: Fri, 3 May 2019 16:51:37 +0000 (-0500) Subject: xfs_io: rework includes for statx structures X-Git-Tag: v5.0.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=868d0cce41645d5a240a7728cdf33b074b3d01f0;p=thirdparty%2Fxfsprogs-dev.git xfs_io: rework includes for statx structures Only include the kernel's linux/stat.h headers if we haven't already picked up statx bits from glibc, to avoid redefinition. Suggested-by: Darrick J. Wong Signed-off-by: Eric Sandeen Tested-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Reviewed-by: Bill O'Donnell Signed-off-by: Eric Sandeen --- diff --git a/io/stat.c b/io/stat.c index 517be66ed..37c0b2e81 100644 --- a/io/stat.c +++ b/io/stat.c @@ -6,9 +6,6 @@ * Portions of statx support written by David Howells (dhowells@redhat.com) */ -/* Try to pick up statx definitions from the system headers. */ -#include - #include "command.h" #include "input.h" #include "init.h" diff --git a/io/statx.h b/io/statx.h index 4f40eaa16..c6625ac43 100644 --- a/io/statx.h +++ b/io/statx.h @@ -33,7 +33,14 @@ # endif #endif + +#ifndef STATX_TYPE +/* Pick up kernel definitions if glibc didn't already provide them */ +#include +#endif + #ifndef STATX_TYPE +/* Local definitions if glibc & kernel headers didn't already provide them */ /* * Timestamp structure for the timestamps in struct statx.