summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Plugins/Monitors/Disk.hs3
-rw-r--r--src/StatFS.hsc4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/Plugins/Monitors/Disk.hs b/src/Plugins/Monitors/Disk.hs
index 461663d..dca268d 100644
--- a/src/Plugins/Monitors/Disk.hs
+++ b/src/Plugins/Monitors/Disk.hs
@@ -83,8 +83,7 @@ fsStats path = do
Nothing -> return [-1, -1, -1]
Just f -> let tot = fsStatByteCount f
free = fsStatBytesAvailable f
- used = fsStatBytesUsed f
- in return [tot, free, used]
+ in return [tot, free, (tot - free)]
speedToStr :: Float -> String
speedToStr = showWithUnits 2 1
diff --git a/src/StatFS.hsc b/src/StatFS.hsc
index d785b89..d007d08 100644
--- a/src/StatFS.hsc
+++ b/src/StatFS.hsc
@@ -58,7 +58,7 @@ foreign import ccall unsafe "sys/vfs.h statfs64"
#endif
c_statfs :: CString -> Ptr CStatfs -> IO CInt
-toI :: CLong -> Integer
+toI :: CULong -> Integer
toI = toInteger
getFileSystemStats :: String -> IO (Maybe FileSystemStats)
@@ -79,5 +79,5 @@ getFileSystemStats path =
, fsStatByteCount = toI bcount * bpb
, fsStatBytesFree = toI bfree * bpb
, fsStatBytesAvailable = toI bavail * bpb
- , fsStatBytesUsed = toI (bcount - bfree) * bpb
+ , fsStatBytesUsed = toI (bcount - bavail) * bpb
}