[commit: ghc] master: SysTools.getTempDir: don't retry after catching a does-not-exist error (12369d6)

git at git.haskell.org git at git.haskell.org
Fri Nov 8 20:50:50 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/12369d6065547215337fdec9587e5fdecd57a45e/ghc

>---------------------------------------------------------------

commit 12369d6065547215337fdec9587e5fdecd57a45e
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Fri Nov 8 09:41:24 2013 -0500

    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)


>---------------------------------------------------------------

12369d6065547215337fdec9587e5fdecd57a45e
 compiler/main/SysTools.lhs |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 0db5e06..46f8a86 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -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 ()



More information about the ghc-commits mailing list