[darcs-users] [trivial] darcs dies when hitting EPIPE on stdout

David Roundy droundy at abridgegame.org
Sat Jan 31 14:50:19 UTC 2004

On Wed, Dec 31, 2003 at 12:37:52AM +0200, Aggelos Economopoulos wrote:
> Trivial testcase:
> aggelos at erwin:~/src/darcs/darcs> darcs changes | head  > /dev/null
> Fail: resource vanished
> Action: commitAndReleaseBuffer
> Handle: {loc=<stdout>,type=writable,binary=False,buffering=block (1024)}
> Reason: Broken pipe
> File: <stdout>
> aggelos at erwin:~/src/darcs/darcs>
> Would it be easy to special-case EPIPE?

Fixed.  It isn't particularly clean, but I've got it working at least under
ghc 6.2.  The problem was that I fixed darcs so it would clean up after
itself in case of a sigPIPE signal (rather than leaving temporaries lying
around), but since I throw an asynchronous exception in case of sigPIPE,
the synchronous exception due to writing to stdout happens first, and I
don't know the type of that exception.  What I've done is to exit without
an error message when there is an IO exception on the file "<stdout>".
This is obviously rather ugly, but I can't see how to find out if the error
David Roundy

More information about the darcs-users mailing list