diff options
-rw-r--r-- | Utility/StatFS.hsc | 5 | ||||
-rw-r--r-- | debian/changelog | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Utility/StatFS.hsc b/Utility/StatFS.hsc index d3e4a507e..937571dfa 100644 --- a/Utility/StatFS.hsc +++ b/Utility/StatFS.hsc @@ -114,7 +114,7 @@ getFileSystemStats path = bfree <- (#peek struct statfs, f_bfree) vfs bavail <- (#peek struct statfs, f_bavail) vfs let bpb = toI bsize - return $ Just FileSystemStats + let stats = FileSystemStats { fsStatBlockSize = bpb , fsStatBlockCount = toI bcount , fsStatByteCount = toI bcount * bpb @@ -122,4 +122,7 @@ getFileSystemStats path = , fsStatBytesAvailable = toI bavail * bpb , fsStatBytesUsed = toI (bcount - bfree) * bpb } + if fsStatBlockCount stats == 0 || fsStatBlockSize stats == 0 + then return Nothing + else return $ Just stats #endif diff --git a/debian/changelog b/debian/changelog index d3c8f9a35..b8b0d7327 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (3.20120114) UNRELEASED; urgency=low + + * Add a sanity check for bad StatFS results. + + -- Joey Hess <joeyh@debian.org> Sat, 14 Jan 2012 17:12:04 -0400 + git-annex (3.20120113) unstable; urgency=low * log: Add --gource mode, which generates output usable by gource. |