summaryrefslogtreecommitdiff
path: root/Utility/DiskFree.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-12 05:48:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-12 05:51:34 -0400
commitc1d039e90542be51402b61db92ce52725bae19ad (patch)
tree5f9d4374917544df0db219de948984687cd19301 /Utility/DiskFree.hs
parentb7e2169d6d93440e2d50581d2a373db121e9b34c (diff)
got hdevtools working on the git-annex source tree
Diffstat (limited to 'Utility/DiskFree.hs')
-rw-r--r--Utility/DiskFree.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Utility/DiskFree.hs b/Utility/DiskFree.hs
index 453244175..20911dd06 100644
--- a/Utility/DiskFree.hs
+++ b/Utility/DiskFree.hs
@@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
module Utility.DiskFree ( getDiskFree ) where
@@ -15,6 +15,8 @@ import Foreign.C.Types
import Foreign.C.String
import Foreign.C.Error
+#ifdef WITH_CLIBS
+
foreign import ccall safe "libdiskfree.h diskfree" c_diskfree
:: CString -> IO CULLong
@@ -27,3 +29,10 @@ getDiskFree path = withFilePath path $ \c_path -> do
)
where
safeErrno (Errno v) = v == 0
+
+#else
+
+getDiskFree :: FilePath -> IO (Maybe Integer)
+getDiskFree _ = return Nothing
+
+#endif