HEADS UP: full rebuild necessary
Páli Gábor János
pali.gabor at gmail.com
Fri Aug 29 17:28:40 UTC 2014
2014-08-29 18:23 GMT+02:00 Edward Z. Yang <ezyang at mit.edu>:
> Could you go ahead and fix them [..] and post your patch?
Sure. Please find it attached.
-------------- next part --------------
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-devs
mailing list