summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadek Podgorny <radek@podgorny.cz>2015-06-14 21:13:03 +0200
committerRadek Podgorny <radek@podgorny.cz>2015-06-14 21:13:03 +0200
commitdf8e7e8d7f5f977b8a567c21edf8d40082f1013e (patch)
tree4ea6876efeea7cf10c0c5268112df5c7cad69928
parent836dd1cb91a899b7fa4a4d4a5389a78c069d302d (diff)
downloadunionfs-fuse-git-df8e7e8d7f5f977b8a567c21edf8d40082f1013e.tar.gz
add conditional compile flags for fuse 2.6
and bumped used version in makefile to 2.8 thanks to <kabe@sra-tohoku.co.jp>
-rw-r--r--src/Makefile2
-rw-r--r--src/unionfs.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index 6444a9e..f3a4feb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,6 +1,6 @@
CFLAGS += -Wall
CPPFLAGS += $(shell pkg-config --cflags fuse)
-CPPFLAGS += -DFUSE_USE_VERSION=26
+CPPFLAGS += -DFUSE_USE_VERSION=28
CPPFLAGS += -DLIBC_XATTR # glibc nowadays includes xattr
# CPPFLAGS += -DLIBATTR_XATTR # define this to libattr xattr include
diff --git a/src/unionfs.c b/src/unionfs.c
index 167d40f..9b13d4e 100644
--- a/src/unionfs.c
+++ b/src/unionfs.c
@@ -267,6 +267,7 @@ static int unionfs_link(const char *from, const char *to) {
RETURN(0);
}
+#if FUSE_USE_VERSION >= 28
static int unionfs_ioctl(const char *path, int cmd, void *arg, struct fuse_file_info *fi, unsigned int flags, void *data) {
(void) path;
(void) arg; // avoid compiler warning
@@ -275,8 +276,10 @@ static int unionfs_ioctl(const char *path, int cmd, void *arg, struct fuse_file_
fprintf(stderr, "Got ioctl: %d\n", cmd);
+#ifdef FUSE_IOCTL_COMPAT // 32bit-mode within 64-bit
if (flags & FUSE_IOCTL_COMPAT)
return -ENOSYS;
+#endif
switch (cmd) {
case UNIONFS_ONOFF_DEBUG: {
@@ -303,6 +306,7 @@ static int unionfs_ioctl(const char *path, int cmd, void *arg, struct fuse_file_
return 0;
}
+#endif
/**
* unionfs mkdir() implementation
@@ -806,7 +810,9 @@ static struct fuse_operations unionfs_oper = {
.fsync = unionfs_fsync,
.getattr = unionfs_getattr,
.init = unionfs_init,
+#if FUSE_USE_VERSION >= 28
.ioctl = unionfs_ioctl,
+#endif
.link = unionfs_link,
.mkdir = unionfs_mkdir,
.mknod = unionfs_mknod,