emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110798: Fix data-loss with --version


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110798: Fix data-loss with --version.
Date: Sun, 04 Nov 2012 09:29:52 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110798
fixes bug: http://debbugs.gnu.org/9574
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sun 2012-11-04 09:29:52 -0800
message:
  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".
modified:
  src/ChangeLog
  src/emacs.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-04 03:34:10 +0000
+++ b/src/ChangeLog     2012-11-04 17:29:52 +0000
@@ -1,3 +1,12 @@
+2012-11-04  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2012-11-03 18:54:17 +0000
+++ b/src/emacs.c       2012-11-04 17:29:52 +0000
@@ -684,7 +684,7 @@
   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 @@
     unexec_init_emacs_zone ();
 #endif
 
+  atexit (close_output_streams);
+
   sort_args (argc, argv);
   argc = 0;
   while (argv[argc]) argc++;
@@ -907,8 +909,6 @@
   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.  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]