diff options
author | marcus <marcus@FreeBSD.org> | 2004-05-01 02:01:17 +0000 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2004-05-01 02:01:17 +0000 |
commit | f954bce7898a555d5119d87cecc0c3bc106676d7 (patch) | |
tree | 688d57cc78bec3569b3ae7e8df7e11a5f247ecfe /deskutils/gdesklets/files | |
parent | b011dcd686b4325c4d8e764c2b5907bf8d6c2251 (diff) | |
download | FreeBSD-ports-f954bce7898a555d5119d87cecc0c3bc106676d7.zip FreeBSD-ports-f954bce7898a555d5119d87cecc0c3bc106676d7.tar.gz |
Update to 0.26.2, and use statvfs() instead of libgtop.get_fsusage() as
the latter has a bug with block vs. I/O size on FreeBSD.
PR: 66115
Submitted by: maintainer
Diffstat (limited to 'deskutils/gdesklets/files')
-rw-r--r-- | deskutils/gdesklets/files/patch-libdesklets::Disk.py | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/deskutils/gdesklets/files/patch-libdesklets::Disk.py b/deskutils/gdesklets/files/patch-libdesklets::Disk.py index 0b4a640..077f487 100644 --- a/deskutils/gdesklets/files/patch-libdesklets::Disk.py +++ b/deskutils/gdesklets/files/patch-libdesklets::Disk.py @@ -1,14 +1,15 @@ ---- libdesklets/Disk.py.orig Mon Feb 23 10:52:50 2004 -+++ libdesklets/Disk.py Mon Feb 23 10:54:31 2004 -@@ -1,6 +1,6 @@ +--- libdesklets/Disk.py.orig Fri Feb 20 14:29:07 2004 ++++ libdesklets/Disk.py Fri Apr 30 15:50:42 2004 +@@ -1,6 +1,7 @@ import glibtop import polling - +import os ++import statvfs class Disk: -@@ -21,14 +21,19 @@ +@@ -21,14 +22,19 @@ # def __poll_partitions(self): @@ -35,3 +36,32 @@ return partitions +@@ -43,15 +49,19 @@ + #:/function + # + def __poll_size(self, partition): +- +- blocks, bfree, bavail, files, ffree = glibtop.get_fsusage(partition) +- free = float(bfree * 512) +- total = float(blocks * 512) +- used = total - free +- +- return (total, used)#, free) +- +- ++ ++ try: ++ statvfs_data = os.statvfs(partition) ++ free = float(statvfs_data[statvfs.F_BFREE] * statvfs_data[statvfs.F_FRSIZE]) ++ total = float(statvfs_data[statvfs.F_BLOCKS] * statvfs_data[statvfs.F_FRSIZE]) ++ except: ++ blocks, bfree, bavail, files, ffree = glibtop.get_fsusage(partition) ++ free = float(bfree * 512) ++ total = float(blocks * 512) ++ ++ used = total - free ++ ++ return (total, used)#, free) + + # + #:function get_fs | partition | Returns the filesystem for the given |