Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7459bcb511e186fa3cb97ed6747bd7cdd977c017

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

commit 7459bcb511e186fa3cb97ed6747bd7cdd977c017
Author: Duncan Coutts <[email protected]>
Date:   Tue Aug 12 22:27:10 2008 +0000

    Don't fail if we don't sync with the child
    It just means we leave a temp file around in the bin dir.

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

 .../Distribution/Client/Win32SelfUpgrade.hs        |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/cabal-install/Distribution/Client/Win32SelfUpgrade.hs 
b/cabal-install/Distribution/Client/Win32SelfUpgrade.hs
index bedbedb..392c1f4 100644
--- a/cabal-install/Distribution/Client/Win32SelfUpgrade.hs
+++ b/cabal-install/Distribution/Client/Win32SelfUpgrade.hs
@@ -124,7 +124,7 @@ scheduleOurDemise verbosity dstPath tmpPath mkArgs = do
   event  <- createEvent syncEventName
 
   let args = mkArgs (show ourPID) tmpPath
-  log $ "launching child " ++ unwords (tmpPath : map show args)
+  log $ "launching child " ++ unwords (dstPath : map show args)
   runProcess dstPath args Nothing Nothing Nothing Nothing Nothing
 
   log $ "waiting for the child to start up"
@@ -174,8 +174,11 @@ foreign import stdcall unsafe "windows.h 
WaitForSingleObject"
 
 waitForSingleObject :: HANDLE -> DWORD -> IO ()
 waitForSingleObject handle timeout = 
-  Win32.failIf_ (/=0) "WaitForSingleObject" $
+  Win32.failIf_ bad "WaitForSingleObject" $
     waitForSingleObject_ handle timeout
+  where
+    bad result   = not (result == 0 || result == wAIT_TIMEOUT)
+    wAIT_TIMEOUT = 0x00000102
 
 foreign import stdcall unsafe "windows.h CreateEventW"
   createEvent_ :: Ptr () -> BOOL -> BOOL -> LPCTSTR -> IO HANDLE



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to