summaryrefslogtreecommitdiffstats
path: root/haskell/Guestfs.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haskell/Guestfs.hs')
-rw-r--r--haskell/Guestfs.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs
index 8f90ee8c..ee7dabd1 100644
--- a/haskell/Guestfs.hs
+++ b/haskell/Guestfs.hs
@@ -81,7 +81,8 @@ module Guestfs (
ping_daemon,
zerofree,
pvresize,
- resize2fs
+ resize2fs,
+ e2fsck_f
) where
import Foreign
import Foreign.C
@@ -827,3 +828,15 @@ resize2fs h device = do
fail err
else return ()
+foreign import ccall unsafe "guestfs_e2fsck_f" c_e2fsck_f
+ :: GuestfsP -> CString -> IO (CInt)
+
+e2fsck_f :: GuestfsH -> String -> IO ()
+e2fsck_f h device = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_e2fsck_f p device)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+