[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r110129: * emacs.c (shut_down_emacs):
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r110129: * emacs.c (shut_down_emacs): Don't assume stderr is buffered, |
Date: |
Sat, 22 Sep 2012 00:34:52 -0700 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 110129
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sat 2012-09-22 00:34:52 -0700
message:
* emacs.c (shut_down_emacs): Don't assume stderr is buffered,
or that fprintf is async-signal-safe. POSIX doesn't require
either assumption.
modified:
src/ChangeLog
src/emacs.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-09-22 03:07:39 +0000
+++ b/src/ChangeLog 2012-09-22 07:34:52 +0000
@@ -1,3 +1,9 @@
+2012-09-22 Paul Eggert <address@hidden>
+
+ * 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 <address@hidden>
* buffer.c (Fset_buffer_modified_p): Handle indirect buffers
=== modified file 'src/emacs.c'
--- a/src/emacs.c 2012-09-17 00:56:08 +0000
+++ b/src/emacs.c 2012-09-22 07:34:52 +0000
@@ -27,6 +27,8 @@
#include <sys/file.h>
#include <unistd.h>
+#include <ignore-value.h>
+
#include "lisp.h"
#ifdef HAVE_WINDOW_SYSTEM
@@ -2012,7 +2014,12 @@
{
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r110129: * emacs.c (shut_down_emacs): Don't assume stderr is buffered,,
Paul Eggert <=