bug-grep
[Top][All Lists]
Advanced

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

Re: [PATCH] main.c: exit on the first EPIPE error


From: Paul Eggert
Subject: Re: [PATCH] main.c: exit on the first EPIPE error
Date: Fri, 20 Jan 2012 09:52:42 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

How about this simpler patch instead?  It simply bails on write
error, which ought to be good enough in practice.

Come to think of it, most of the other "error (0, ...)"s are
bogus -- I'll try to take a look at them and post a more-systematic
patch along the following lines.
                                         
--- a/src/main.c                                                                
+++ b/src/main.c                                                                
@@ -881,7 +881,7 @@ prline (char const *beg, char const *lim, int sep)
     fwrite (beg, 1, lim - beg, stdout);                                        
                                                                                
   if (ferror (stdout))                                                         
-    error (0, errno, _("writing output"));                                     
+    error (EXIT_TROUBLE, errno, _("writing output"));                          
                                                                                
   lastout = lim;                                                               
                                    



reply via email to

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