From: Roman Bogorodskiy Date: Sun, 11 Nov 2018 14:31:15 +0000 (+0400) Subject: Fix build on non-Linux X-Git-Tag: fuse-3.4.1~13 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=70e25ea74e011d73887f4f66842b204fb4504c97;p=qemu-gpiodev%2Flibfuse.git 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() --- 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 #include #include -#ifndef __NetBSD__ +#if !defined( __NetBSD__) && !defined(__FreeBSD__) #include +#else +#define IGNORE_MTAB #endif #include #include #include #include -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__FreeBSD__) #define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0) #endif