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