summaryrefslogtreecommitdiff
path: root/filesystems/glusterfs/patches/patch-ae
blob: 6e78d978a1d62ea5b022d7970d0df30334803200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$NetBSD: patch-ae,v 1.8 2011/10/16 05:45:19 manu Exp $

On NetBSD use libperfuse(3), rename umount2(2) as unmount(2), and skip
inexistant /etc/mtab management.

Include <signal.h> for sigprocmask(2)

--- contrib/fuse-lib/mount.c.orig	2011-08-23 14:31:36.000000000 +0200
+++ contrib/fuse-lib/mount.c	2011-10-14 15:15:40.000000000 +0200
@@ -19,16 +19,24 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
+#include <signal.h>
+#ifndef __NetBSD__
 #include <mntent.h>
+#endif /* __NetBSD__ */
 #include <sys/stat.h>
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/wait.h>
 #include <sys/mount.h>
 
+#ifdef __NetBSD__
+#include <perfuse.h>
+#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
+#endif
+
 #ifdef FUSE_UTIL
 #define MALLOC(size) malloc (size)
 #define FREE(ptr) free (ptr)
 #define GFFUSE_LOGERR(...) fprintf (stderr, ## __VA_ARGS__)
@@ -57,8 +65,9 @@
  * - s/free/FREE/, s/malloc/MALLOC/
  * - there are some other minor things
  */
 
+#ifndef __NetBSD__
 static int
 mtab_needs_update (const char *mnt)
 {
         int res;
@@ -90,8 +99,11 @@
         }
 
         return 1;
 }
+#else /* __NetBSD__ */
+#define mtab_needs_update(x) 1
+#endif /* __NetBSD__ */
 
 #ifndef FUSE_UTIL
 static
 #endif