]> granicus.if.org Git - strace/commitdiff
tests: robustify statx test
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 16 Jul 2019 17:46:47 +0000 (17:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 16 Jul 2019 17:46:47 +0000 (17:46 +0000)
Do not assume that <linux/stat.h> defines struct statx.

* configure.ac (AC_CHECK_TYPES): Check for struct statx in
<linux/stat.h>.
* tests/statx.c: Conditionalize on HAVE_STRUCT_STATX along with
__NR_statx.

configure.ac
tests/statx.c

index 624fc7c0c35ab24e0c991c7f3a3654b466791c7b..3394357ba281aa6cf3c64feba1ea1b204b5f6700 100644 (file)
@@ -556,6 +556,9 @@ AC_CHECK_TYPES([struct statfs64], [
 ],, [#include <linux/types.h>
 #include <asm/statfs.h>])
 
+AC_CHECK_TYPES([struct statx],,, [#include <linux/types.h>
+#include <linux/stat.h>])
+
 AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
 
 AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
index c5e86ad2e8344bbe89b61534988be0e0eeb209ac..e0815b743984919eef5a38e25d3f6e1aceb1609f 100644 (file)
@@ -8,7 +8,7 @@
 #include "tests.h"
 #include <asm/unistd.h>
 
-#ifdef __NR_statx
+#if defined __NR_statx && defined HAVE_STRUCT_STATX
 
 # include <linux/stat.h>
 # include "xlat.h"
@@ -45,6 +45,6 @@ static const char *TEST_SYSCALL_STATX_MASK_STR  = "STATX_ALL";
 
 #else
 
-SKIP_MAIN_UNDEFINED("__NR_statx")
+SKIP_MAIN_UNDEFINED("__NR_statx && HAVE_STRUCT_STATX")
 
 #endif