Commit 01108e3f authored by Paul Eggert's avatar Paul Eggert

* emacs.c (shut_down_emacs): Don't assume stderr is buffered,

or that fprintf is async-signal-safe.  POSIX doesn't require
either assumption.
parent 47133380
2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
* emacs.c (shut_down_emacs): Don't assume stderr is buffered,
or that fprintf is async-signal-safe. POSIX doesn't require
either assumption.
2012-09-22 Chong Yidong <cyd@gnu.org>
* buffer.c (Fset_buffer_modified_p): Handle indirect buffers
......
......@@ -27,6 +27,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/file.h>
#include <unistd.h>
#include <ignore-value.h>
#include "lisp.h"
#ifdef HAVE_WINDOW_SYSTEM
......@@ -2012,7 +2014,12 @@ shut_down_emacs (int sig, Lisp_Object stuff)
{
reset_all_sys_modes ();
if (sig && sig != SIGTERM)
fprintf (stderr, "Fatal error %d: %s", sig, strsignal (sig));
{
char buf[100];
int buflen = snprintf (buf, sizeof buf, "Fatal error %d: %s",
sig, strsignal (sig));
ignore_value (write (STDERR_FILENO, buf, buflen));
}
}
}
#else
......
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