diff options
author | Richard Jones <rjones@redhat.com> | 2009-05-21 16:18:16 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-05-21 16:18:16 +0100 |
commit | 3e408f493496597dc026d20778837f421f05a9dd (patch) | |
tree | 5aee1850ae052c36ab56de764d4130789280c7a8 /haskell | |
parent | 0f81d0941a2705d49bc129f69924265fa60d9677 (diff) | |
download | libguestfs-3e408f493496597dc026d20778837f421f05a9dd.tar.gz libguestfs-3e408f493496597dc026d20778837f421f05a9dd.tar.xz libguestfs-3e408f493496597dc026d20778837f421f05a9dd.zip |
Generated code for e2fsck-f command.
Diffstat (limited to 'haskell')
-rw-r--r-- | haskell/Guestfs.hs | 15 |
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 () + |