[LTP] [PATCH v2] statx: fix compile errors

Thadeu Lima de Souza Cascardo cascardo@canonical.com
Wed Sep 26 16:15:45 CEST 2018


struct statx is only defined in sys/stat.h when _GNU_SOURCE is defined.
The testcases do define _GNU_SOURCE, but not the m4 struct check.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 m4/ltp-statx.m4 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/m4/ltp-statx.m4 b/m4/ltp-statx.m4
index 44303d3..5f79a94 100644
--- a/m4/ltp-statx.m4
+++ b/m4/ltp-statx.m4
@@ -23,6 +23,11 @@ dnl
 AC_DEFUN([LTP_CHECK_STATX],[
 AC_CHECK_FUNCS(statx,,,[[#include <sys/stat.h>]])
 AC_CHECK_HEADER(linux/fs.h,,,)
-AC_CHECK_TYPES([struct statx],,,[[#include <sys/stat.h>]])
-AC_CHECK_TYPES([struct statx_timestamp],,,[[#include <sys/stat.h>]])
+AC_CHECK_TYPES([struct statx],,,[[
+	#define _GNU_SOURCE
+	#include <sys/stat.h>
+]])
+AC_CHECK_TYPES([struct statx_timestamp],,,[[
+	#define _GNU_SOURCE
+	#include <sys/stat.h>]])
 ])
-- 
2.17.1



More information about the ltp mailing list