diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-08-05 22:04:11 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-08-05 22:04:11 +0200 |
commit | c07525ac4692a2ee9c76bd0bd53c195c8164480f (patch) | |
tree | c8b84685ee88c3c46f5d9f7b19404ea6e261bd8b /src/Process.hs | |
parent | e4a392c1c3089e0ec77601d99cd19be4403bb3a1 (diff) |
Diffstat (limited to 'src/Process.hs')
-rw-r--r-- | src/Process.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Process.hs b/src/Process.hs index 31641c9..8ea345d 100644 --- a/src/Process.hs +++ b/src/Process.hs @@ -85,9 +85,10 @@ outProc otype p line = outLine otype (Just $ textProcName $ procName p) line lineReadingLoop :: MonadOutput m => Process -> Handle -> (Text -> m ()) -> m () lineReadingLoop process h act = liftIO (tryIOError (T.hGetLine h)) >>= \case - Left err - | isEOFError err -> return () - | otherwise -> outProc OutputChildFail process $ T.pack $ "IO error: " ++ show err + Left err -> do + when (not (isEOFError err)) $ do + outProc OutputChildFail process $ T.pack $ "IO error: " ++ show err + liftIO $ hClose h Right line -> do act line lineReadingLoop process h act |