SysTools.getTempDir: don't retry after catching a does-not-exist error
authorPatrick Palka <patrick@parcs.ath.cx>
Fri, 8 Nov 2013 14:41:24 +0000 (09:41 -0500)
committerPatrick Palka <patrick@parcs.ath.cx>
Fri, 8 Nov 2013 18:00:30 +0000 (13:00 -0500)
commit12369d6065547215337fdec9587e5fdecd57a45e
treee79fba0d12a1517e9cae8fd5ddfe90fe29ebff32
parenta1b6932419a2d425b2a3b7672926a0f9c368f234
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)
compiler/main/SysTools.lhs