[commit: packages/Cabal] ghc-head: 'syncProcess': don't restore handlers before the child finished. (ec09372)

git at git.haskell.org git at git.haskell.org
Sat Oct 26 21:58:37 UTC 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/packages/Cabal.git/commitdiff/ec093725eb39a9fc8929d9ee684bdc62914f1995

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

commit ec093725eb39a9fc8929d9ee684bdc62914f1995
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Fri Oct 25 16:49:22 2013 +0200

    'syncProcess': don't restore handlers before the child finished.
    
    Fixes #1560.


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

ec093725eb39a9fc8929d9ee684bdc62914f1995
 Cabal/Distribution/Simple/Utils.hs |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Cabal/Distribution/Simple/Utils.hs b/Cabal/Distribution/Simple/Utils.hs
index 9a5fe3d..54caa39 100644
--- a/Cabal/Distribution/Simple/Utils.hs
+++ b/Cabal/Distribution/Simple/Utils.hs
@@ -408,10 +408,10 @@ syncProcess fun c = do
   -- in the child (using SIG_DFL isn't really correct, it should be the
   -- original signal handler, but the GHC RTS will have already set up
   -- its own handler and we don't want to use that).
-  (_,_,_,p) <- Exception.bracket (installHandlers) (restoreHandlers) $
-               (\_ -> runGenProcess_ fun c
-                      (Just defaultSignal) (Just defaultSignal))
-  r <- waitForProcess p
+  r <- Exception.bracket (installHandlers) (restoreHandlers) $
+       (\_ -> do (_,_,_,p) <- runGenProcess_ fun c
+                              (Just defaultSignal) (Just defaultSignal)
+                 waitForProcess p)
   return r
     where
       installHandlers = do



More information about the ghc-commits mailing list