aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mount_util.c
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/mount_util.c
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/mount_util.c')
-rw-r--r--lib/mount_util.c6
1 files changed, 4 insertions, 2 deletions
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