2006-01-24 23:27:07 +01:00
|
|
|
$NetBSD: patch-af,v 1.4 2006/01/24 22:27:07 joerg Exp $
|
2004-09-15 18:33:38 +02:00
|
|
|
|
2006-01-24 23:27:07 +01:00
|
|
|
--- filesys.c.orig 2000-04-27 12:48:54.000000000 +0000
|
|
|
|
+++ filesys.c
|
|
|
|
@@ -11,7 +11,7 @@
|
|
|
|
#include "filesys.h"
|
2004-09-15 18:33:38 +02:00
|
|
|
|
2006-01-24 23:27:07 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
-#ifdef __NetBSD__
|
|
|
|
+#if defined(__NetBSD__) || defined(__DragonFly__)
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#endif
|
|
|
|
@@ -399,7 +399,12 @@ short sfremovedir(char *name)
|
2004-09-15 18:33:38 +02:00
|
|
|
|
2006-01-24 23:27:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
-#if defined(__linux__) || defined(__NetBSD__)
|
|
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__)
|
|
|
|
+
|
|
|
|
+#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900)) || defined(__DragonFly__)
|
2004-09-15 18:33:38 +02:00
|
|
|
+#include <sys/statvfs.h>
|
|
|
|
+#endif
|
|
|
|
+
|
2006-01-24 23:27:07 +01:00
|
|
|
|
2004-09-15 18:33:38 +02:00
|
|
|
/* simply copied that widespread file access code of former dpbox code */
|
|
|
|
/* in this single file. Not a real change to previous versions of the */
|
2006-01-24 23:27:07 +01:00
|
|
|
@@ -413,9 +418,15 @@ long Diskfree(int dummy)
|
2004-09-15 18:33:38 +02:00
|
|
|
|
|
|
|
long DFree(char *mount)
|
|
|
|
{
|
2006-01-24 23:27:07 +01:00
|
|
|
+#if (defined(__NetBSD__) && (__NetBSD_Version__ < 299000900))
|
2004-09-15 18:33:38 +02:00
|
|
|
struct statfs mystatfs;
|
|
|
|
|
|
|
|
statfs(mount, &mystatfs);
|
|
|
|
+#else
|
|
|
|
+ struct statvfs mystatfs;
|
|
|
|
+
|
|
|
|
+ statvfs(mount, &mystatfs);
|
|
|
|
+#endif
|
|
|
|
if (mystatfs.f_bsize % 1024 == 0)
|
|
|
|
return (mystatfs.f_bsize / 1024) * mystatfs.f_bavail;
|
|
|
|
else
|
2006-01-24 23:27:07 +01:00
|
|
|
@@ -1523,7 +1534,7 @@ void _filesys_init(void)
|
|
|
|
#ifdef __macos__
|
|
|
|
StartupFilesysInit();
|
|
|
|
#endif
|
|
|
|
-#if defined(__linux__) || defined(__NetBSD__)
|
|
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__)
|
|
|
|
nextptr = NULL;
|
|
|
|
#endif
|
|
|
|
}
|