pkgsrc/misc/kdeutils3/patches/patch-ad
2006-01-05 20:25:16 +00:00

48 lines
1.5 KiB
Text

$NetBSD: patch-ad,v 1.4 2006/01/05 20:25:16 joerg Exp $
--- ksim/monitors/filesystem/filesystemstats.cpp.orig 2005-10-05 13:26:44.000000000 +0000
+++ ksim/monitors/filesystem/filesystemstats.cpp
@@ -30,7 +30,7 @@
#include <sys/types.h>
#include <sys/param.h>
-#ifdef HAVE_SYS_STATVFS_H
+#if defined(HAVE_SYS_STATVFS_H) && !defined(__DragonFly__)
#include <sys/statvfs.h>
#elif defined( HAVE_SYS_STATFS_H )
#include <sys/statfs.h>
@@ -56,10 +56,12 @@
#include <stdio.h>
#include <unistd.h>
-#ifdef HAVE_STATVFS
+#if defined(HAVE_STATVFS) && !defined(__DragonFly__)
typedef struct statvfs ksim_statfs;
+#define ksim_getfsstat getvfsstat
#elif defined( HAVE_STATFS ) || defined( Q_OS_FREEBSD )
typedef struct statfs ksim_statfs;
+#define ksim_getfsstat getfsstat
#else
typedef struct // fall back for (possibly) non-supported systems
{
@@ -70,7 +72,7 @@ typedef struct // fall back for (possibl
int fsystemStats( const char * file, ksim_statfs & stats )
{
-#ifdef HAVE_STATVFS
+#if defined(HAVE_STATVFS) && !defined(__DragonFly__)
return statvfs( file, &stats );
#elif defined( HAVE_STATFS ) || defined( Q_OS_FREEBSD )
return statfs( file, &stats );
@@ -159,9 +161,9 @@ FilesystemStats::List FilesystemStats::r
#endif
#ifdef USE_FSSTAT
- struct statfs sfs[32];
+ ksim_statfs sfs[32];
int fs_count;
- if ( ( fs_count = getfsstat( sfs, sizeof( sfs ), 0 ) ) != -1 )
+ if ( ( fs_count = ksim_getfsstat( sfs, sizeof( sfs ), 0 ) ) != -1 )
{
for ( int i = 0; i < fs_count; i++ )
{