Commit 76abf5e5 authored by Paul Eggert's avatar Paul Eggert

Fix data-loss with --version.

* emacs.c (close_output_streams): Use strerror, not emacs_strerror,
as we can't assume that emacs_strerror is initialized, and strerror
is good enough here.
(main): Invoke atexit earlier, to catch earlier instances of
sending data to stdout and exiting, e.g., "emacs --version >/dev/full".

Fixes: debbugs:9574
parent f200a427
2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
Fix data-loss with --version (Bug#9574).
* emacs.c (close_output_streams): Use strerror, not emacs_strerror,
as we can't assume that emacs_strerror is initialized, and strerror
is good enough here.
(main): Invoke atexit earlier, to catch earlier instances of
sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
* nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
......
......@@ -684,7 +684,7 @@ close_output_streams (void)
if (close_stream (stdout) != 0)
{
fprintf (stderr, "Write error to standard output: %s\n",
emacs_strerror (errno));
strerror (errno));
fflush (stderr);
_exit (EXIT_FAILURE);
}
......@@ -748,6 +748,8 @@ main (int argc, char **argv)
unexec_init_emacs_zone ();
#endif
atexit (close_output_streams);
sort_args (argc, argv);
argc = 0;
while (argv[argc]) argc++;
......@@ -907,8 +909,6 @@ main (int argc, char **argv)
if (do_initial_setlocale)
setlocale (LC_ALL, "");
atexit (close_output_streams);
inhibit_window_system = 0;
/* Handle the -t switch, which specifies filename to use as terminal. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment