2014-08-29 18:23 GMT+02:00 Edward Z. Yang <[email protected]>:
> Could you go ahead and fix them [..] and post your patch?

Sure.  Please find it attached.
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
_______________________________________________
ghc-devs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/ghc-devs

Reply via email to