diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/emacs.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dff41f1dbb..44a7606831 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-09-23 Andreas Schwab <[email protected]> + + * emacs.c (Fkill_emacs): In noninteractive mode exit + non-successfully if a write error occurred on stdout. (Bug#9574) + 2011-09-21 Eli Zaretskii <[email protected]> * xdisp.c (pop_it): Allow it->object that is a cons cell to pass diff --git a/src/emacs.c b/src/emacs.c index 321e7919c9..0a684d4423 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1993,6 +1993,7 @@ all of which are called before Emacs is actually killed. */) { struct gcpro gcpro1; Lisp_Object hook; + int exit_code; GCPRO1 (arg); @@ -2017,7 +2018,10 @@ all of which are called before Emacs is actually killed. */) if (STRINGP (Vauto_save_list_file_name)) unlink (SSDATA (Vauto_save_list_file_name)); - exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS); + exit_code = EXIT_SUCCESS; + if (noninteractive && fflush (stdout)) + exit_code = EXIT_FAILURE; + exit (INTEGERP (arg) ? XINT (arg) : exit_code); } |