Subject: bug#23267: closed (Re: bug#23267: suggestion: silently ignore EPIPE errors when SIGPIPE is set to 'ignore')

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 22 Sep 2020 22:36:02 +0000

Your bug report

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

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
23267: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23267
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#23267: suggestion: silently ignore EPIPE errors when SIGPIPE is set to 'ignore'
From: Paul Eggert <[email-masked]>
To: Assaf Gordon <[email-masked]>
Cc: [email-masked]
Date: Tue, 22 Sep 2020 15:35:32 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

I'm cleaning up old grep bug reports and am closing this one as wontfix.

Subject: suggestion: silently ignore EPIPE errors when SIGPIPE is set to 'ignore'
From: Assaf Gordon <[email-masked]>
To: [email-masked]
Date: Mon, 11 Apr 2016 02:36:26 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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