Fix sign bug in disk free space checking.

Giulio Eulisse reported that on OSX, bad free space numbers were being
shown. It thought he had negative free space.

While the documentation is not clear, especially across OS's, it seems
likely that statfs uses unsigned long. It doesn't make sense for any
numbers to be negative.
This commit is contained in:
Joey Hess 2011-07-05 20:53:58 -04:00
parent cab4ac247c
commit 497b1e6092
2 changed files with 7 additions and 1 deletions

View file

@ -96,7 +96,7 @@ foreign import ccall unsafe "sys/vfs.h statfs64"
c_statfs :: CString -> Ptr CStatfs -> IO CInt c_statfs :: CString -> Ptr CStatfs -> IO CInt
#endif #endif
toI :: CLong -> Integer toI :: CULong -> Integer
toI = toInteger toI = toInteger
getFileSystemStats :: String -> IO (Maybe FileSystemStats) getFileSystemStats :: String -> IO (Maybe FileSystemStats)

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
git-annex (3.20110706) UNRELEASED; urgency=low
* Fix sign bug in disk free space checking.
-- Joey Hess <joeyh@debian.org> Tue, 05 Jul 2011 20:52:11 -0400
git-annex (3.20110705) unstable; urgency=low git-annex (3.20110705) unstable; urgency=low
* uninit: Delete the git-annex branch and .git/annex/ * uninit: Delete the git-annex branch and .git/annex/