Use the correct errno and remove cleanupRunningProcess
[lsp-test.git] / src / Language / Haskell / LSP / Test / Compat.hs
index a6151949a07d7486db2069662cba52c112038dd9..883bfc9ef32e5db25a0eb22a22e204fa9cf3d512 100644 (file)
@@ -69,10 +69,6 @@ getProcessID p = fromIntegral . fromJust <$> getProcessID' p
       _ -> return Nothing
 #endif
 
-cleanupRunningProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO ()
-cleanupRunningProcess p@(_, _, _, ph) =
-  getProcessExitCode ph >>= maybe (cleanupProcess p) (const $ return ())
-
 cleanupProcess
   :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO ()
 
@@ -102,7 +98,7 @@ cleanupProcess (mb_stdin, mb_stdout, mb_stderr, ph) = do
 
     return ()
   where ignoreSigPipe = ignoreIOError ResourceVanished ePIPE
-        ignorePermDenied = ignoreIOError PermissionDenied ePERM
+        ignorePermDenied = ignoreIOError PermissionDenied eACCES
     
 ignoreIOError :: IOErrorType -> Errno -> IO () -> IO ()
 ignoreIOError ioErrorType errno =