bug-grep
[Top][All Lists]
Advanced

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

bug#23267: suggestion: silently ignore EPIPE errors when SIGPIPE is set


From: Assaf Gordon
Subject: bug#23267: suggestion: silently ignore EPIPE errors when SIGPIPE is set to 'ignore'
Date: Mon, 11 Apr 2016 02:36:26 -0400

Hello,

This is a small addition to a recent change:
   1cec27a7f0e5c7bdc44a88ef51af09f87a8cbc24 
   grep: use errno consistently in write diagnostics

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
( http://lists.gnu.org/archive/html/coreutils/2016-04/msg00004.html ) perhaps 
it would be better
to have special case for EPIPE and exit silently (as if SIGPIPE was not ignored 
and terminated the program?).

Patch attached for such modification.

One issue of which I'm not certain: I assumed that if 'prline' was called, a 
match was found.
Thus, EPIPE will result in exit(EXIT_SUCCESS) indicating a match.


Comments welcomed,
 - Assaf

Attachment: 0001-grep-silently-ignore-EPIPE-errors.patch
Description: Binary data


reply via email to

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