aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoman Bogorodskiy <bogorodskiy@gmail.com>2018-11-11 18:31:15 +0400
committerNikolaus Rath <Nikolaus@rath.org>2018-11-11 19:40:25 +0000
commit70e25ea74e011d73887f4f66842b204fb4504c97 (patch)
tree79504fddc5ec17e0a921ff7ce2613414ad0db2aa /lib
parent30415af0dc538f7b7e864773230c2bb74d28f985 (diff)
downloadlibfuse-70e25ea74e011d73887f4f66842b204fb4504c97.tar.gz
Fix build on non-Linux
* Update meson.build to add mount_util.c to libfuse_sources unconditionally, it's non Linux-only * FreeBSD, like NetBSD, doesn't have mntent.h, so don't include that and define IGNORE_MTAB for both * FreeBSD, like NetBSD, has no umount2() sysctl, so similarly define it to unmount()
Diffstat (limited to 'lib')
-rw-r--r--lib/meson.build4
-rw-r--r--lib/mount_util.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/meson.build b/lib/meson.build
index 492abf7..996bcfd 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,10 +1,10 @@
libfuse_sources = ['fuse.c', 'fuse_i.h', 'fuse_loop.c', 'fuse_loop_mt.c',
'fuse_lowlevel.c', 'fuse_misc.h', 'fuse_opt.c',
'fuse_signals.c', 'buffer.c', 'cuse_lowlevel.c',
- 'helper.c', 'modules/subdir.c' ]
+ 'helper.c', 'modules/subdir.c', 'mount_util.c' ]
if host_machine.system().startswith('linux')
- libfuse_sources += [ 'mount.c', 'mount_util.c' ]
+ libfuse_sources += [ 'mount.c' ]
else
libfuse_sources += [ 'mount_bsd.c' ]
endif
diff --git a/lib/mount_util.c b/lib/mount_util.c
index 95e038f..48324c8 100644
--- a/lib/mount_util.c
+++ b/lib/mount_util.c
@@ -20,15 +20,17 @@
#include <fcntl.h>
#include <limits.h>
#include <paths.h>
-#ifndef __NetBSD__
+#if !defined( __NetBSD__) && !defined(__FreeBSD__)
#include <mntent.h>
+#else
+#define IGNORE_MTAB
#endif
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/mount.h>
#include <sys/param.h>
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
#define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
#endif