use safe FFI imports for diskfree

There's a minor performance overhead to doing this, but this way I don't
have to worry about a situation where statfs might block for a long time.
For example, when it's on a network filesystem.
This commit is contained in:
Joey Hess 2012-07-20 15:03:58 -04:00
parent da4c506d61
commit 9d26b532ab

View file

@ -15,7 +15,7 @@ import Foreign.C.Types
import Foreign.C.String
import Foreign.C.Error
foreign import ccall unsafe "libdiskfree.h diskfree" c_diskfree
foreign import ccall safe "libdiskfree.h diskfree" c_diskfree
:: CString -> IO CULLong
getDiskFree :: FilePath -> IO (Maybe Integer)