Skip to content

Commit

Permalink
Remove duplication between branches
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjaguarpaw committed May 23, 2023
1 parent 2404906 commit e6667db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/System/Process/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ startProcess pConfig'@ProcessConfig {..} = liftIO $ do
-- then call waitForProcess ourselves
Left _ -> do
eres <- try $ P.terminateProcess pHandle
ec <-
case eres of
case eres of
Left e
-- On Windows, with the single-threaded runtime, it
-- seems that if a process has already exited, the
Expand All @@ -272,9 +271,10 @@ startProcess pConfig'@ProcessConfig {..} = liftIO $ do
-- Recommendation: always use the multi-threaded
-- runtime!
| isPermissionError e && not multiThreadedRuntime && isWindows ->
P.waitForProcess pHandle
| otherwise -> throwIO e >> P.waitForProcess pHandle
Right () -> P.waitForProcess pHandle
pure ()
| otherwise -> throwIO e
Right () -> pure ()
ec <- P.waitForProcess pHandle
success <- atomically $ tryPutTMVar pExitCode ec
evaluate $ assert success ()

Expand Down

0 comments on commit e6667db

Please sign in to comment.