summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Add.hs6
-rw-r--r--Utility/StatFS.hsc4
-rw-r--r--Utility/Touch.hsc4
3 files changed, 6 insertions, 8 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 944525ea5..f437d160d 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -84,9 +84,9 @@ cleanup file key hascontent = do
-- file it points to
-- XXX Currently broken on non-utf8 locales when
-- dealing with utf-8 filenames.
- --liftIO $ do
- --mtime <- modificationTime <$> getFileStatus file
- --touch file (TimeSpec mtime) False
+ liftIO $ do
+ mtime <- modificationTime <$> getFileStatus file
+ touch file (TimeSpec mtime) False
force <- Annex.getState Annex.force
if force
diff --git a/Utility/StatFS.hsc b/Utility/StatFS.hsc
index 937571dfa..6b9627463 100644
--- a/Utility/StatFS.hsc
+++ b/Utility/StatFS.hsc
@@ -50,8 +50,6 @@ module Utility.StatFS ( FileSystemStats(..), getFileSystemStats ) where
import Foreign
import Foreign.C.Types
import Foreign.C.String
-import Data.ByteString (useAsCString)
-import Data.ByteString.Char8 (pack)
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
# include <sys/param.h>
@@ -105,7 +103,7 @@ getFileSystemStats path =
return Nothing
#else
allocaBytes (#size struct statfs) $ \vfs ->
- useAsCString (pack path) $ \cpath -> do
+ withCAString path $ \cpath -> do
res <- c_statfs cpath vfs
if res == -1 then return Nothing
else do
diff --git a/Utility/Touch.hsc b/Utility/Touch.hsc
index fd3320cd1..41d3e17b8 100644
--- a/Utility/Touch.hsc
+++ b/Utility/Touch.hsc
@@ -64,7 +64,7 @@ foreign import ccall "utimensat"
touchBoth file atime mtime follow =
allocaArray 2 $ \ptr ->
- withCString file $ \f -> do
+ withCAString file $ \f -> do
pokeArray ptr [atime, mtime]
r <- c_utimensat at_fdcwd f ptr flags
when (r /= 0) $ throwErrno "touchBoth"
@@ -101,7 +101,7 @@ foreign import ccall "lutimes"
touchBoth file atime mtime follow =
allocaArray 2 $ \ptr ->
- withCString file $ \f -> do
+ withCAString file $ \f -> do
pokeArray ptr [atime, mtime]
r <- syscall f ptr
if (r /= 0)