diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-11-03 11:54:17 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-11-03 11:54:17 -0700 |
commit | 7ccfb720b477df05042729e0e300bae5922f5120 (patch) | |
tree | d5bfded71b48dfefbc4e3334c0ae586de29ab7bc /lib/fpending.h | |
parent | 376a8e83bb3438f77dadf2d9910ef7baabcc82c2 (diff) | |
download | emacs-7ccfb720b477df05042729e0e300bae5922f5120.tar.gz |
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.
Fixes: debbugs:9574
Diffstat (limited to 'lib/fpending.h')
-rw-r--r-- | lib/fpending.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/fpending.h b/lib/fpending.h new file mode 100644 index 00000000000..0365287ba76 --- /dev/null +++ b/lib/fpending.h @@ -0,0 +1,30 @@ +/* Declare __fpending. + + Copyright (C) 2000, 2003, 2005-2006, 2009-2012 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + Written by Jim Meyering. */ + +#include <stddef.h> +#include <stdio.h> + +#if HAVE_DECL___FPENDING +# if HAVE_STDIO_EXT_H +# include <stdio_ext.h> +# endif +#else +size_t __fpending (FILE *); +#endif |