summaryrefslogtreecommitdiff
path: root/filesystems/fuse-encfs/patches/patch-ac
blob: 5996c3f85effd1a6e651b748519692b8ee8f6712 (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
$NetBSD: patch-ac,v 1.1.1.1 2007/03/01 00:34:14 xtraeme Exp $

--- encfs/encfs.cpp.orig	2007-03-01 01:05:53.000000000 +0100
+++ encfs/encfs.cpp	2007-03-01 01:10:17.000000000 +0100
@@ -23,7 +23,11 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <errno.h>
+#ifndef __NetBSD__
 #include <sys/statfs.h>
+#else
+#include <sys/statvfs.h>
+#endif
 
 #include <sys/types.h>
 
@@ -497,7 +501,11 @@
     return res;
 }
 
+#ifndef __NetBSD__
 int encfs_statfs(const char *path, struct statfs *st)
+#else
+int encfs_statfs(const char *path, struct statvfs *st)
+#endif
 {
     int res = -EIO;
     try
@@ -507,11 +515,19 @@
 	string cyName = FSRoot->rootDirectory();
 
 	rLog(Info, "doing statfs of %s", cyName.c_str());
+#ifndef __NetBSD__
 	res = statfs( cyName.c_str(), st );
+#else
+	res = statvfs(cyName.c_str(), st);
+#endif
 	if(!res) 
 	{
+#ifndef __NetBSD__
 	    // adjust maximum name length..
 	    st->f_namelen     = 6 * (st->f_namelen - 2) / 8; // approx..
+#else
+	    st->f_namemax     = 6 * (st->f_namemax - 2) / 8;
+#endif
 	}
 	if(res == -1)
 	    res = -errno;