aboutsummaryrefslogtreecommitdiff
path: root/Utility/Tmp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-07 12:29:34 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-07 12:29:34 -0400
commit6a44b7716aa702a068b301cc8608c0116a5cd90f (patch)
tree8773d46c1bd73117cfd09857dcc28ad74554f9b5 /Utility/Tmp.hs
parentcf9af38cf75618e2953c5b537d8f7c1fe353aa63 (diff)
parent4542ddaf4e58da6d02d41e6365d68506df8ccd4c (diff)
Merge branch 'master' into smudge
Diffstat (limited to 'Utility/Tmp.hs')
-rw-r--r--Utility/Tmp.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Utility/Tmp.hs b/Utility/Tmp.hs
index de970fe56..7e4db1101 100644
--- a/Utility/Tmp.hs
+++ b/Utility/Tmp.hs
@@ -88,8 +88,9 @@ withTmpDirIn tmpdir template = bracketIO create remove
makenewdir (tmpdir </> template) (0 :: Int)
makenewdir t n = do
let dir = t ++ "." ++ show n
- either (const $ makenewdir t $ n + 1) (const $ return dir)
- =<< tryIO (createDirectory dir)
+ catchIOErrorType AlreadyExists (const $ makenewdir t $ n + 1) $ do
+ createDirectory dir
+ return dir
{- It's not safe to use a FilePath of an existing file as the template
- for openTempFile, because if the FilePath is really long, the tmpfile