summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac5
-rw-r--r--loop.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index ec8db2d..82c8e87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,6 +254,11 @@ AC_CHECK_DECLS(m4_normalize([
PTRACE_SETOPTIONS
]),,, [#include <sys/ptrace.h>])
+AC_CHECK_DECLS(m4_normalize([
+ LO_FLAGS_AUTOCLEAR,
+ LO_FLAGS_PARTSCAN
+]),,, [#include <linux/loop.h>])
+
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <stdlib.h>
diff --git a/loop.c b/loop.c
index a350135..83d9152 100644
--- a/loop.c
+++ b/loop.c
@@ -33,8 +33,10 @@
static const struct xlat loop_flags_options[] = {
{ LO_FLAGS_READ_ONLY, "LO_FLAGS_READ_ONLY" },
+#if HAVE_DECL_LO_FLAGS_AUTOCLEAR
{ LO_FLAGS_AUTOCLEAR, "LO_FLAGS_AUTOCLEAR" },
-#ifdef LO_FLAGS_PARTSCAN
+#endif
+#if HAVE_DECL_LO_FLAGS_PARTSCAN
{ LO_FLAGS_PARTSCAN, "LO_FLAGS_PARTSCAN" },
#endif
{ 0, NULL },
@@ -164,7 +166,9 @@ int loop_ioctl(struct tcb *tcp, long code, long arg)
return 1;
case LOOP_CLR_FD:
+#ifdef LOOP_SET_CAPACITY
case LOOP_SET_CAPACITY:
+#endif
#ifdef LOOP_CTL_GET_FREE
/* newer loop-control stuff */
case LOOP_CTL_GET_FREE: