aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
authorAndreas Schwab <[email protected]>2011-09-23 11:56:55 +0200
committerAndreas Schwab <[email protected]>2011-09-23 11:56:55 +0200
commit8eca8a7c4885c27af36f52320185dbcae5f693e0 (patch)
tree0c94d765a5536b2c3d6e631b28957e03632f3d79 /src/emacs.c
parent916830895691c3f7a944d195f5d0d38e3c109439 (diff)
* src/emacs.c (Fkill_emacs): In noninteractive mode exit
non-successfully if a write error occurred on stdout. (Bug#9574)
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c6
1 files changed, 5 insertions, 1 deletions
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);
}