diff --git a/configure.ac b/configure.ac index 2c33d77779..df39df2fba 100644 --- a/configure.ac +++ b/configure.ac @@ -874,6 +874,9 @@ if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then unshare (!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); ], [ with_lxc=yes + AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], + [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR', + and to 0 if you don't.]) ], [ if test "$with_lxc" = "check"; then with_lxc=no diff --git a/src/util/virfile.c b/src/util/virfile.c index 6a4386974e..dd64e88a03 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -497,7 +497,7 @@ int virFileUpdatePerm(const char *path, } -#ifdef __linux__ +#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR static int virFileLoopDeviceOpen(char **dev_name) { int fd = -1;