diff options
| author | Eli Zaretskii | 2015-02-18 23:14:31 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-02-18 23:14:31 +0200 |
| commit | 7932d062cf85c2c37bd15b22be30a65c034001fc (patch) | |
| tree | 120c1bd60232913ca8c6bc61312c135ec5ee454b | |
| parent | b1d6ddd44614c84746f5ee494e1f29cd9be8a2d8 (diff) | |
| download | emacs-7932d062cf85c2c37bd15b22be30a65c034001fc.tar.gz emacs-7932d062cf85c2c37bd15b22be30a65c034001fc.zip | |
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.
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2015-02-18 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * emacs.c (Fkill_emacs): Exit with specified exit code even if | ||
| 4 | stdin is at EOF. (Bug#19897) | ||
| 5 | |||
| 1 | 2015-02-18 Oscar Fuentes <ofv@wanadoo.es> | 6 | 2015-02-18 Oscar Fuentes <ofv@wanadoo.es> |
| 2 | 7 | ||
| 3 | * keyboard.c (read_char): When there is an input method function, | 8 | * 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. */ | |||
| 1896 | 1896 | ||
| 1897 | GCPRO1 (arg); | 1897 | GCPRO1 (arg); |
| 1898 | 1898 | ||
| 1899 | if (feof (stdin)) | ||
| 1900 | arg = Qt; | ||
| 1901 | |||
| 1902 | /* Fsignal calls emacs_abort () if it sees that waiting_for_input is | 1899 | /* Fsignal calls emacs_abort () if it sees that waiting_for_input is |
| 1903 | set. */ | 1900 | set. */ |
| 1904 | waiting_for_input = 0; | 1901 | waiting_for_input = 0; |
| @@ -1910,7 +1907,7 @@ all of which are called before Emacs is actually killed. */ | |||
| 1910 | x_clipboard_manager_save_all (); | 1907 | x_clipboard_manager_save_all (); |
| 1911 | #endif | 1908 | #endif |
| 1912 | 1909 | ||
| 1913 | shut_down_emacs (0, STRINGP (arg) ? arg : Qnil); | 1910 | shut_down_emacs (0, (STRINGP (arg) && !feof (stdin)) ? arg : Qnil); |
| 1914 | 1911 | ||
| 1915 | #ifdef HAVE_NS | 1912 | #ifdef HAVE_NS |
| 1916 | ns_release_autorelease_pool (ns_pool); | 1913 | ns_release_autorelease_pool (ns_pool); |