Skip to content

Commit

Permalink
'syncProcess': don't restore handlers before the child finished.
Browse files Browse the repository at this point in the history
Fixes #1560.
  • Loading branch information
23Skidoo committed Oct 25, 2013
1 parent e3e3702 commit ec09372
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cabal/Distribution/Simple/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec09372

Please sign in to comment.