or that fprintf is async-signal-safe. POSIX doesn't require
either assumption.
+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
#include <sys/file.h>
#include <unistd.h>
+#include <ignore-value.h>
+
#include "lisp.h"
#ifdef HAVE_WINDOW_SYSTEM
{
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