50 lines
1.5 KiB
Text
50 lines
1.5 KiB
Text
$NetBSD: patch-ab,v 1.6 2006/02/23 20:15:21 joerg Exp $
|
|
|
|
--- source/blender/blenlib/intern/storage.c.orig 2005-04-30 09:57:35.000000000 +0000
|
|
+++ source/blender/blenlib/intern/storage.c
|
|
@@ -50,6 +50,10 @@
|
|
#include <time.h>
|
|
#include <sys/stat.h>
|
|
|
|
+#if defined(__DragonFly__)
|
|
+#include <sys/statvfs.h>
|
|
+#endif
|
|
+
|
|
#if !defined(linux) && (defined(__sgi) || defined(__sun__) || defined(__sun) || defined(__sparc) || defined(__sparc__))
|
|
#include <sys/statfs.h>
|
|
#endif
|
|
@@ -89,10 +93,6 @@ struct statfs {
|
|
#include <pwd.h>
|
|
#endif
|
|
|
|
-#if !defined(__FreeBSD__) && !defined(__APPLE__)
|
|
-#include <malloc.h>
|
|
-#endif
|
|
-
|
|
/* lib includes */
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
@@ -177,7 +177,11 @@ double BLI_diskfree(char *dir)
|
|
|
|
return (double) (freec*bytesps*sectorspc);
|
|
#else
|
|
+#if defined(__DragonFly__) || (defined (__NetBSD__) && __NetBSD_Version__ >= 299000900) /* 2.99.9 */
|
|
+ struct statvfs disk;
|
|
+#else
|
|
struct statfs disk;
|
|
+#endif
|
|
char name[100],*slash;
|
|
|
|
|
|
@@ -188,7 +192,10 @@ double BLI_diskfree(char *dir)
|
|
if (slash) slash[1] = 0;
|
|
} else strcpy(name,"/");
|
|
|
|
-#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__)
|
|
+#if defined(__DragonFly__) || (defined (__NetBSD__) && __NetBSD_Version__ >= 299000900) /* 2.99.9 */
|
|
+ if (statvfs(name, &disk)) return(-1);
|
|
+#elif defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || \
|
|
+ defined (__APPLE__) || defined (__NetBSD__)
|
|
if (statfs(name, &disk)) return(-1);
|
|
#endif
|
|
#ifdef __BeOS
|