Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: subtle `echo' bug



Bart Schaefer wrote:
> On Jun 15,  2:56pm, Peter Stephenson wrote:
> }
> } This is rather garbled: the error message shown was a write error which
> } you certainly wouldn't see if the process that failed to write received
> } a SIGPIPE.
> 
> SIGPIPE is one of those signals that causes a process to exit if it is
> not trapped, and zsh does not trap it.  So there's no opportunity for
> the error message to be printed.

That's what I was trying to say in a somewhat garbled fashion.

> } Experimentation suggests a SIGPIPE to a subprocess in a pipeline in
> } other shells doesn't cause the shell to abort execution.
>
> So, we could try this patch:

Seems OK so far; are the other signals we should be treating similarly?

Would it be safer to use WTERMSIG(val) instead of (val - 128)?

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author