Commit 12369d60 authored by parcs's avatar parcs
Browse files

SysTools.getTempDir: don't retry after catching a does-not-exist error

Previously, a command like

$ ghc -tmpdir blah Foo

where the directory blah/ does not exist, would loop forever: getTempDir
would repeatedly try to create a temporary subdirectory inside blah/,
catching the does-not-exist error thrown by createDirectory and
retrying, in vain, with another suffix.

Now instead the above compiler invocation will fail with an error:

blah/ghc25781_0: createDirectory: does not exist (No such file or directory)
parent a1b69324
......@@ -910,7 +910,7 @@ getTempDir dflags = do
Just dir -> do
removeDirectory our_dir
return dir
`catchIO` \e -> if isAlreadyExistsError e || isDoesNotExistError e
`catchIO` \e -> if isAlreadyExistsError e
then mkTempDir prefix else ioError e
addFilesToClean :: DynFlags -> [FilePath] -> IO ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment