aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <mszeredi@suse.cz>2013-07-25 17:58:48 +0200
committerGravatar Miklos Szeredi <mszeredi@suse.cz>2013-07-25 17:58:48 +0200
commit3c3f03b81f3027ef0a25bd790605265b384b93c1 (patch)
treebf3dd9c26414cb7f97f090cbc2a61062824566b2 /example
parent0cb2db32e73cb06716ea797374c42e99d782643b (diff)
ulockmgr: strip ulockmgr support from this source package
Distribute ulockmgr separately. It is not needed for the building of libfuse, only fusexmp_fh. Check ulockmgr library in ./configure and if not disable remote-lock suport in fusexmp_fh.
Diffstat (limited to 'example')
-rw-r--r--example/Makefile.am2
-rwxr-xr-xexample/fusexmp_fh.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/example/Makefile.am b/example/Makefile.am
index 8b123d2..0db537b 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -6,7 +6,7 @@ noinst_PROGRAMS = fusexmp fusexmp_fh null hello hello_ll fioc fioclient \
fsel fselclient cusexmp
LDADD = ../lib/libfuse3.la
-fusexmp_fh_LDADD = ../lib/libfuse3.la ../lib/libulockmgr.la
+fusexmp_fh_LDADD = ../lib/libfuse3.la @fusexmp_fh_libs@
fioclient_CPPFLAGS =
fioclient_LDFLAGS =
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c
index 3be5071..ba6789b 100755
--- a/example/fusexmp_fh.c
+++ b/example/fusexmp_fh.c
@@ -29,7 +29,11 @@
#define _GNU_SOURCE
#include <fuse.h>
+
+#ifdef HAVE_LIBULOCKMGR
#include <ulockmgr.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -500,6 +504,7 @@ static int xmp_removexattr(const char *path, const char *name)
}
#endif /* HAVE_SETXATTR */
+#ifdef HAVE_LIBULOCKMGR
static int xmp_lock(const char *path, struct fuse_file_info *fi, int cmd,
struct flock *lock)
{
@@ -508,6 +513,7 @@ static int xmp_lock(const char *path, struct fuse_file_info *fi, int cmd,
return ulockmgr_op(fi->fh, cmd, lock, &fi->lock_owner,
sizeof(fi->lock_owner));
}
+#endif
static int xmp_flock(const char *path, struct fuse_file_info *fi, int op)
{
@@ -562,7 +568,9 @@ static struct fuse_operations xmp_oper = {
.listxattr = xmp_listxattr,
.removexattr = xmp_removexattr,
#endif
+#ifdef HAVE_LIBULOCKMGR
.lock = xmp_lock,
+#endif
.flock = xmp_flock,
};