From 7932d062cf85c2c37bd15b22be30a65c034001fc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 18 Feb 2015 23:14:31 +0200 Subject: [PATCH] Fix exit code when stdin is at EOF (Bug#19897) src/emacs.c (Fkill_emacs): Exit with specified exit code even if stdin is at EOF. --- src/ChangeLog | 5 +++++ src/emacs.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8a3b534e7ae..1c4758f969b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-02-18 Eli Zaretskii + + * emacs.c (Fkill_emacs): Exit with specified exit code even if + stdin is at EOF. (Bug#19897) + 2015-02-18 Oscar Fuentes * keyboard.c (read_char): When there is an input method function, diff --git a/src/emacs.c b/src/emacs.c index fdd17d1e062..f933eb1443d 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1896,9 +1896,6 @@ all of which are called before Emacs is actually killed. */ GCPRO1 (arg); - if (feof (stdin)) - arg = Qt; - /* Fsignal calls emacs_abort () if it sees that waiting_for_input is set. */ waiting_for_input = 0; @@ -1910,7 +1907,7 @@ all of which are called before Emacs is actually killed. */ x_clipboard_manager_save_all (); #endif - shut_down_emacs (0, STRINGP (arg) ? arg : Qnil); + shut_down_emacs (0, (STRINGP (arg) && !feof (stdin)) ? arg : Qnil); #ifdef HAVE_NS ns_release_autorelease_pool (ns_pool); -- 2.39.2