Roland Mainz wrote:
> Danek Duvall wrote:
>> Roland Mainz wrote:
>>> Roland Mainz wrote:
>>>> Does anyone know in which conditions "cat" may return an exit code of
>>>> "141" when writing to a FIFO ?
>>> The question wasn't 100% correct. It should be: In which conditions can
>>> the statement "cat foo.txt >myfifo" return an exit code of "141" (e.g.
>>> either "cat" or the redirection seems to fail but I am not sure (since I
>>> am doing remote debugging via email... ;-( )) ?
>> The exit code indicates that the process caught SIGPIPE.  And write(2) says
>> that SIGPIPE will be sent to a process that tries to write to a pipe or
>> fifo that isn't open for reading by any process.  But I presume you knew
>> that.
> 
> Right... I hoped that someone knows a more obsure condition which may
> trigger this exit code...

So, I don't understand; do you have reason to believe there's no writing 
to a pipe going on, and no possible early child death?

If you don't know it's *not* the case, isn't it reasonable to assume it is?

> 
>> I don't know offhand how to reproduce that, though, since your command will
>> block on the open() if nothing's listening on the other end, and should
>> they have modified their shell to open with O_NONBLOCK, the open will
>> simply fail.  Perhaps between the open() and the write(), the reader died?
> 
> I don't know... half of the issue is that I am doing remote debugging
> via email and can't replicate the condition on my machine... ;-(
> 
> ----
> 
> Bye,
> Roland
> 


Reply via email to