diff mbox

[ndctl] ndctl, test: check availability of MAP_SYNC for poison test

Message ID 153005436089.18842.1250190791301459045.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Williams June 26, 2018, 11:06 p.m. UTC
The poison handling test requires the systems that have both MAP_SYNC
and BUS_MCEERR_AR definitions. Add the missing MAP_SYNC gate for this
test to detect this functionality at build time.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 configure.ac |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 17b5a657149c..cf4426076c65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,10 +102,13 @@  AS_IF([test "x$enable_test" = "xyes"],
 	[AC_DEFINE([ENABLE_TEST], [1], [ndctl test support])])
 AM_CONDITIONAL([ENABLE_TEST], [test "x$enable_test" = "xyes"])
 
-AC_CHECK_DECLS([BUS_MCEERR_AR], [enable_poison=yes], [], [[#include <signal.h>]])
-AS_IF([test "x$enable_poison" = "xyes"],
+AC_CHECK_DECLS([BUS_MCEERR_AR], [enable_bus_mc_err=yes], [], [[#include <signal.h>]])
+AC_CHECK_DECLS([MAP_SYNC], [enable_map_sync=yes], [], [[#include <linux/mman.h>]])
+
+AS_IF([test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"],
 	[AC_DEFINE([ENABLE_POISON], [1], [ndctl test poison support])])
-AM_CONDITIONAL([ENABLE_POISON], [test "x$enable_poison" = "xyes"])
+AM_CONDITIONAL([ENABLE_POISON],
+	[test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"])
 
 PKG_CHECK_MODULES([KMOD], [libkmod])
 PKG_CHECK_MODULES([UDEV], [libudev])