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:
parent
da4c506d61
commit
9d26b532ab
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ import Foreign.C.Types
|
||||||
import Foreign.C.String
|
import Foreign.C.String
|
||||||
import Foreign.C.Error
|
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
|
:: CString -> IO CULLong
|
||||||
|
|
||||||
getDiskFree :: FilePath -> IO (Maybe Integer)
|
getDiskFree :: FilePath -> IO (Maybe Integer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue