aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-24 15:53:29 -0800
committerEryu Guan <eguan@redhat.com>2018-01-25 15:55:07 +0800
commita6b5c98da8c4b47831752657ef010b17622c8dd7 (patch)
tree6a1363c2b96c9eeb1b97f317ecfa79b18a5da06f
parent074740a32c6a36c5ba7d4be66dd4ee63e9f744f3 (diff)
downloadxfstests-a6b5c98da8c4b47831752657ef010b17622c8dd7.tar.gz
xfs/122: fix xfs header ordering problems
XFS headers are supposed to be included in a certain order so that inline functions actually compile correctly. For the most part the shell feeds us the files in an order that works, but with the addition of the xfs_dir2_dirblock_bytes function this doesn't always work now. Therefore, explicitly #include the headers in the required order. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rwxr-xr-xtests/xfs/1225
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/xfs/122 b/tests/xfs/122
index 671a77bcef..d836670156 100755
--- a/tests/xfs/122
+++ b/tests/xfs/122
@@ -79,6 +79,11 @@ cat >$cprog <<EOF
#define _GNU_SOURCE
#include <stdio.h>
EOF
+# Certain headers must be included in a certain order...
+for hdr in xfs.h xfs_types.h xfs_fs.h xfs_arch.h xfs_format.h; do
+ test -e "/usr/include/xfs/$hdr" && echo "#include <xfs/$hdr>" >> $cprog
+done
+# ...but be sure to pull in any new headers that might show up.
for hdr in /usr/include/xfs/xfs*.h; do
echo "#include <$(echo "$hdr" | sed -e 's|/usr/include/||g')>" >> $cprog
done