src/stat_test: fix undefined reference to `xfstests_statx'
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Tue, 7 Aug 2018 12:35:51 +0000 (20:35 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Aug 2018 12:03:20 +0000 (20:03 +0800)
commitaa0b82a9fd976ca50fba25c12461a7f3dd7af102
treed032926d441c2e5a7f8db54b1400697d39902b4e
parent7931e0696c8e77b3172b5fb0b2ffa9a16597462d
src/stat_test: fix undefined reference to `xfstests_statx'

Since glibc 2.28 has added the statx function after commit
fd70af45528d ("Add the statx function"), stat_test.c will include
/usr/include/bits/statx.h eventually by "include <sys/stat.h>". That
causes the STATX_TYPE has already been defined before include
"status.h", then xfstests_statx will not be defined.

So make fails with the following error message:

/usr/bin/ld: /tmp/cc2Isfch.o: in function `main':
/home/luke/workspace/xfstests-dev/src/stat_test.c:690: undefined reference to `xfstests_statx'
/usr/bin/ld: /tmp/cc2Isfch.o: in function `get_reference':
/home/luke/workspace/xfstests-dev/src/stat_test.c:301: undefined reference to `xfstests_statx'
/usr/bin/ld: /tmp/cc2Isfch.o: in function `main':
/home/luke/workspace/xfstests-dev/src/stat_test.c:642: undefined reference to `xfstests_statx'

Just move out the definition of xfstests_statx between "#ifndef
STATX_TYPE" and "#endif /* STATX_TYPE */".

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/statx.h