summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-02-10 08:14:16 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-02-10 08:14:16 +0800
commit4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d (patch)
tree27b63cf66d96018f3f61e0921d0863df3c130585 /devel
parent01cdaf14775fee43523432dfce498ecca42aa7e2 (diff)
downloadmarcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.tar
marcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.tar.gz
marcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.tar.bz2
marcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.tar.lz
marcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.tar.xz
marcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.tar.zst
marcuscom-ports-4e1ce0db06d1e3dad09b2ff2ae14d0d2c332047d.zip
Allow file system space to be properly reported once again.
Reported by: mezz tcb on #freebsd-gnome git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@10383 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel')
-rw-r--r--devel/libgtop/Makefile4
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c55
2 files changed, 51 insertions, 8 deletions
diff --git a/devel/libgtop/Makefile b/devel/libgtop/Makefile
index 14b43803f..ea73d1cab 100644
--- a/devel/libgtop/Makefile
+++ b/devel/libgtop/Makefile
@@ -3,12 +3,12 @@
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/devel/libgtop/Makefile,v 1.27 2008/01/15 02:37:36 mezz Exp $
+# $MCom: ports/devel/libgtop/Makefile,v 1.28 2008/02/09 17:51:21 marcus Exp $
#
PORTNAME= libgtop
PORTVERSION= 2.21.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c b/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
index 3269c8dd4..3f9a03cb2 100644
--- a/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
@@ -1,18 +1,61 @@
---- sysdeps/freebsd/fsusage.c.orig 2007-11-03 00:00:42.000000000 -0400
-+++ sysdeps/freebsd/fsusage.c 2007-11-03 00:03:44.000000000 -0400
-@@ -22,14 +22,7 @@
+--- sysdeps/freebsd/fsusage.c.orig 2007-06-03 16:06:05.000000000 -0400
++++ sysdeps/freebsd/fsusage.c 2008-02-09 19:10:28.000000000 -0500
+@@ -10,6 +10,7 @@
+ #include <unistd.h>
+ #include <sys/param.h>
+ #include <sys/mount.h>
++#include <sys/statvfs.h>
+ #if __FreeBSD_version >= 600000 || defined(__FreeBSD_kernel__)
+ #include <libgeom.h>
+ #include <sys/resource.h>
+@@ -21,15 +22,13 @@
+ #include <string.h>
#include <stdlib.h>
- void
+-void
-_glibtop_freebsd_get_fsusage_read_write(glibtop *server,
- glibtop_fsusage *buf,
- const char *path);
--
++static const unsigned long _glibtop_sysdeps_fsusage =
++(1L << GLIBTOP_FSUSAGE_BLOCKS) + (1L << GLIBTOP_FSUSAGE_BFREE)
+++ (1L << GLIBTOP_FSUSAGE_BAVAIL) + (1L << GLIBTOP_FSUSAGE_FILES)
+++ (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE);
+
-void
-_glibtop_freebsd_get_fsusage_read_write(glibtop *server,
- glibtop_fsusage *buf,
- const char *path)
-+glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path)
++static void
++_glibtop_get_fsusage_read_write (glibtop *server, glibtop_fsusage *buf, const char *path)
{
int result;
struct statfs sfs;
+@@ -135,3 +134,28 @@ _glibtop_freebsd_get_fsusage_read_write(
+ #endif
+ buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
+ }
++
++void
++glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path)
++{
++ struct statvfs fsd;
++
++ glibtop_init_r (&server, 0, 0);
++
++ memset (buf, 0, sizeof (glibtop_fsusage));
++
++ if (statvfs (path, &fsd) < 0)
++ return;
++
++ buf->block_size = fsd.f_bsize;
++ buf->blocks = fsd.f_blocks;
++ buf->bfree = fsd.f_bfree;
++ buf->bavail = (fsd.f_bavail > fsd.f_bfree) ? 0 : fsd.f_bavail;
++ buf->files = fsd.f_files;
++ buf->ffree = fsd.f_ffree;
++
++ buf->flags = _glibtop_sysdeps_fsusage;
++
++ _glibtop_get_fsusage_read_write(server, buf, path);
++}
++