Skip to content
Snippets Groups Projects
Commit ec093725 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

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

Fixes #1560.
parent e3e3702a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment