[commit: ghc] master: Fix to bin-package-db for ming32-only code (eac8728)
git at git.haskell.org
git at git.haskell.org
Fri Aug 29 21:09:12 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/eac8728691db95085d0530b748388de0f8f5732b/ghc
>---------------------------------------------------------------
commit eac8728691db95085d0530b748388de0f8f5732b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Aug 29 22:06:56 2014 +0100
Fix to bin-package-db for ming32-only code
Patch written by Pali Gabor Janos <pali.gabor at gmail.com>
>---------------------------------------------------------------
eac8728691db95085d0530b748388de0f8f5732b
libraries/bin-package-db/GHC/PackageDb.hs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libraries/bin-package-db/GHC/PackageDb.hs b/libraries/bin-package-db/GHC/PackageDb.hs
index 5039a01..76fa697 100644
--- a/libraries/bin-package-db/GHC/PackageDb.hs
+++ b/libraries/bin-package-db/GHC/PackageDb.hs
@@ -261,15 +261,15 @@ writeFileAtomic targetPath content = do
#if mingw32_HOST_OS || mingw32_TARGET_OS
renameFile tmpPath targetPath
-- If the targetPath exists then renameFile will fail
- `catchIO` \err -> do
+ `catch` \err -> do
exists <- doesFileExist targetPath
if exists
then do removeFile targetPath
-- Big fat hairy race condition
- renameFile newFile targetPath
+ renameFile tmpPath targetPath
-- If the removeFile succeeds and the renameFile fails
-- then we've lost the atomic property.
- else throwIOIO err
+ else throwIO (err :: IOException)
#else
renameFile tmpPath targetPath
#endif
More information about the ghc-commits
mailing list