On Thu, 2013-06-27 at 10:09 +1000, Craig Small wrote: > Oh and using all those brackets in commit messages is cheating! I assume you meant parenthesis, not brackets, so how's this for not cheating: ------------------------------------------------------ ( gnulib provides for optionally ignoring EPIPE, but ) ( if a program chooses to ignore it, then their code ) ( appears to suffer from this close_stream oversight ) The gnulib provides for optionally ignoring EPIPE, but if any program chooses to ignore it, then that library code seems to suffer from the same close_stream lapse. ------------------------------------------------------ By the way, you might be surprised to learn that the 'write error' is a pretty recent failure. This bug only surfaced with release 3.3.6. That's when top was equipped to produce dumps under selected signals. In other words, the path-length to program end became slightly longer with an additional function call. Prior to that time there was no error message with SIGPIPE/EPIPE because the close_stream fclose() returned an EOF error which was represented as 'fclose_fail'. With 3.3.6, the fclose() succeeded and we were left with just the 'prev_fail' flag. So it appears to be a matter of timing. In fact, without that patch you can avoid the 'write error' by limiting top output via a maxtasks ('n' command) of say 10 preserved in the rcfile. Regards, Jim