summaryrefslogtreecommitdiff
path: root/Utility/Touch.hsc
diff options
context:
space:
mode:
Diffstat (limited to 'Utility/Touch.hsc')
-rw-r--r--Utility/Touch.hsc7
1 files changed, 3 insertions, 4 deletions
diff --git a/Utility/Touch.hsc b/Utility/Touch.hsc
index b53eab634..e2dba79ab 100644
--- a/Utility/Touch.hsc
+++ b/Utility/Touch.hsc
@@ -106,9 +106,8 @@ touchBoth file atime mtime follow =
withFilePath file $ \f -> do
pokeArray ptr [atime, mtime]
r <- syscall f ptr
- if (r /= 0)
- then throwErrno "touchBoth"
- else return ()
+ when (r /= 0) $
+ throwErrno "touchBoth"
where
syscall = if follow
then c_lutimes
@@ -116,6 +115,6 @@ touchBoth file atime mtime follow =
#else
#warning "utimensat and lutimes not available; building without symlink timestamp preservation support"
-touchBoth _ _ _ _ = return ()
+touchBoth _ _ _ _ = noop
#endif
#endif