projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a9e028
)
getTemporaryDirectory: be more precise when catching exns from getEnv
author
Simon Marlow
<simonmar@microsoft.com>
Mon, 18 Feb 2008 12:29:08 +0000
(12:29 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Mon, 18 Feb 2008 12:29:08 +0000
(12:29 +0000)
System/Directory.hs
patch
|
blob
|
history
diff --git
a/System/Directory.hs
b/System/Directory.hs
index
80a20ee
..
d705c0d
100644
(file)
--- a/
System/Directory.hs
+++ b/
System/Directory.hs
@@
-1027,7
+1027,10
@@
getTemporaryDirectory = do
r <- c_GetTempPath (fromIntegral long_path_size) pPath
peekCString pPath
#else
r <- c_GetTempPath (fromIntegral long_path_size) pPath
peekCString pPath
#else
- catch (getEnv "TMPDIR") (\ex -> return "/tmp")
+ getEnv "TMPDIR"
+ `catch` \ex -> case ex of
+ IOException e | isDoesNotExistError e -> return "/tmp"
+ _ -> throw ex
#endif
#if defined(mingw32_HOST_OS)
#endif
#if defined(mingw32_HOST_OS)