Thanks to visit codestin.com
Credit goes to bugs.darcs.net

darcs

Message23272

Author bfrk
Recipients darcs-devel, falsifian
Date 2023-05-26.07:47:40
Issue Issue2703 darcs log hangs after quitting pager
Content
I just realized that what we do here is incorrect even on Linux. In 
src/Darcs/Util/SignalHandler.hs it says

                     | s == sigPIPE = exitWith $ ExitFailure 1

And indeed, when I run `darcs log` and then hit 'q' to terminate the 
pager, the exit code is 1, which is wrong. I think that, at least when 
we pipe our output through a pager, we should ignore SIGPIPE and handle 
(i.e catch and ignore) the EPIPE error when the write fails. Looking 
closer at the code in src/Darcs/UI/External.hs, I see that there *is* 
code to handle EPIPE in the function ortryrunning, which among other 
things also handles the ResourceVanished exception ... which (if I 
understand things correctly) should not be raised because we do have a 
handler for SIGPIPE.

The signal handling code is very old and quite messy, so I may have 
overlooked something. And it doesn't explain why the behavior differs 
between Linux and OpenBSD.
History
Date User Action Args
2023-05-26 07:47:40bfrkcreate
2023-05-26 07:47:40bfrklinkissue2703 messages
2023-05-26 07:47:40bfrksetrecipients: + falsifian, darcs-devel
2023-05-26 07:47:40bfrksetmessageid: <[email protected]>