bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tee logs no output if stdout is closed


From: Jim Meyering
Subject: Re: tee logs no output if stdout is closed
Date: Fri, 03 Oct 2008 14:31:55 +0200

Paolo Bonzini <address@hidden> wrote:
> Jim,
>
>> Imagine a scenario in which the pipe reader is expected always to
>> be reading, and so the pipe writer can expect that any write failure with
>> errno==EPIPE indicates the reader has terminated unexpectedly.
>
> If the writer should terminate first, the reader can still detect the
> failure using SIGPIPE and/or SIGCHLD.  Since you say that you consider

The above was assuming that SIGPIPE is being ignored.  My goal is for the
_writer_ to be able to detect write failure due to EPIPE (via gnulib's
close_* functions), even when there is no parent child relationship
between the reader and writer.

> ignoring the signal to be discouraged, these programs should not see
> EPIPE anyway.  Yes, you also said:
>
>> Some environments (mis-configured login/csh) have
>> resulted in the default SIGPIPE handler being SIG_IGN.
>
> ... but there are so many other problems that could result from
> misconfiguration, such as fd 0/1/2 not being open.  I don't think

I agree.  we should not cater to misconfigured environments.
Just mentioning one context in which SIGPIPE should not be ignored.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]