diff --git a/cabal-testsuite/src/Test/Cabal/Server.hs b/cabal-testsuite/src/Test/Cabal/Server.hs index 8a2fbb981dd..450c6f660c7 100644 --- a/cabal-testsuite/src/Test/Cabal/Server.hs +++ b/cabal-testsuite/src/Test/Cabal/Server.hs @@ -250,19 +250,17 @@ startServer chan senv = do initServer :: Server -> IO Server initServer s0 = do -- NB: withProcessHandle reads an MVar and is interruptible -#if mingw32_HOST_OS + pid <- withProcessHandle (serverProcessHandle s0) $ \ph -> case ph of +#if mingw32_HOST_OS OpenHandle x -> fmap show (Win32.getProcessId x) - -- TODO: handle OpenExtHandle? - _ -> return (serverProcessId s0) #else - pid <- withProcessHandle (serverProcessHandle s0) $ \ph -> - case ph of OpenHandle x -> return (show x) +#endif -- TODO: handle OpenExtHandle? _ -> return (serverProcessId s0) -#endif + let s = s0 { serverProcessId = pid } -- We will read/write a line at a time, including for -- output; our demarcation tokens are an entire line.