pkgsrc/filesystems/fuse-encfs/patches/patch-ac

49 lines
1.2 KiB
Text
Raw Normal View History

$NetBSD: patch-ac,v 1.2 2012/08/17 15:15:27 marino 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>
+#if !defined (__NetBSD__) && !defined (__DragonFly__)
#include <sys/statfs.h>
+#else
+#include <sys/statvfs.h>
+#endif
#include <sys/types.h>
@@ -497,7 +501,11 @@
return res;
}
+#if !defined (__NetBSD__) && !defined (__DragonFly__)
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());
+#if !defined (__NetBSD__) && !defined (__DragonFly__)
res = statfs( cyName.c_str(), st );
+#else
+ res = statvfs(cyName.c_str(), st);
+#endif
if(!res)
{
+#if !defined (__NetBSD__) && !defined (__DragonFly__)
// 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;