Fix data-loss with --batch.
commit8203e13c0e26319e4f88f6659b377cab9963da7a
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Nov 2012 18:54:17 +0000 (3 11:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Nov 2012 18:54:17 +0000 (3 11:54 -0700)
tree7709c474a939abd3ca50e0072f6eba64745b8091
parent1cdc32c58c206ab23d252afc765eb685c488b4b8
Fix data-loss with --batch.

* admin/merge-gnulib (GNULIB_MODULES): Add close-stream.
* lib/close-stream.c, lib/close-stream.h, lib/fpending.c
* lib/fpending.h, m4/close-stream.m4, m4/fpending.m4:
New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* src/emacs.c: Include <close-stream.h>.
(close_output_streams): New function.
(main): Pass it to atexit, so that Emacs closes stdout and stderr
and handles errors appropriately.
(Fkill_emacs): Don't worry about flushing, as close_output_stream
does that now.
13 files changed:
ChangeLog
admin/ChangeLog
admin/merge-gnulib
lib/close-stream.c [new file with mode: 0644]
lib/close-stream.h [new file with mode: 0644]
lib/fpending.c [new file with mode: 0644]
lib/fpending.h [new file with mode: 0644]
lib/gnulib.mk
m4/close-stream.m4 [new file with mode: 0644]
m4/fpending.m4 [new file with mode: 0644]
m4/gnulib-comp.m4
src/ChangeLog
src/emacs.c