|
From: | Paul Eggert |
Subject: | bug#23267: suggestion: silently ignore EPIPE errors when SIGPIPE is set to 'ignore' |
Date: | Mon, 11 Apr 2016 00:47:13 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
Assaf Gordon wrote:
With the above change, if SIGPIPE is set to 'ignore' (e.g. by the shell or python), then grep would exit with "write error: Broken Pipe". Based on recent suggestion from Pádraig Brady
I don't see why this is would be a good idea. grep should report write errors.A caller that doesn't care about EPIPE output errors should invoke 'grep' with the default behavior for SIGPIPE and should ignore grep's exit status; this is longstanding tradition. As far as I can see, it's a mistake to ignore SIGPIPE while expecting a status of zero with no output-error diagnostics. Such a mistake would affect lots of programs other than 'grep', and it's not incumbent on utility writers to work around mistakes like this.
[Prev in Thread] | Current Thread | [Next in Thread] |