summaryrefslogtreecommitdiff
path: root/Touch.hsc
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-15 12:47:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-15 12:47:14 -0400
commit6c396a256c93464d726c66a95132536941871ee8 (patch)
tree7f934c9eae22a9cfd3fb1672ebd7bf6870439c81 /Touch.hsc
parent185f0b687081f47d059cc0503f4f6b671868f753 (diff)
finished hlint pass
Diffstat (limited to 'Touch.hsc')
-rw-r--r--Touch.hsc5
1 files changed, 2 insertions, 3 deletions
diff --git a/Touch.hsc b/Touch.hsc
index 4f26855d2..dd0c38984 100644
--- a/Touch.hsc
+++ b/Touch.hsc
@@ -15,6 +15,7 @@ module Touch (
import Foreign
import Foreign.C
+import Control.Monad (when)
newtype TimeSpec = TimeSpec CTime
@@ -66,9 +67,7 @@ touchBoth file atime mtime follow =
withCString file $ \f -> do
pokeArray ptr [atime, mtime]
r <- c_utimensat at_fdcwd f ptr flags
- if (r /= 0)
- then throwErrno "touchBoth"
- else return ()
+ when (r /= 0) $ throwErrno "touchBoth"
where
flags = if follow
then 0