Subject: bug#9574: data-loss with --batch: ignored write failure

From: Glenn Morris <[email-masked]>
Date: Mon, 16 Apr 2012 21:58:03 -0400

Jim Meyering wrote:

> A clean fix for the entire problem (including --help and --version and
> anything else that may write to stdout) would be to ensure that no other
> code path explicitly closes stdout and to add this line in main:
>
>     atexit (close_stdout);
>
> However, that would require gnulib's closeout module and would probably
> end up being too invasive a change to make during a code freeze.

Such a change could probably be applied to the Emacs trunk now...
(Cc'ing Paul since he has done most/all of the gnulib additions in Emacs.)