bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19897: 24.3; Emacs exits with exit code 0 if EOF of stdin has been r


From: Philipp Stephani
Subject: bug#19897: 24.3; Emacs exits with exit code 0 if EOF of stdin has been reached
Date: Thu, 19 Feb 2015 11:47:25 +0000





Eli Zaretskii <eliz@gnu.org> schrieb am Wed Feb 18 2015 at 10:16:29 PM:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 18 Feb 2015 21:58:42 +0100
>
> This has been discussed in
> https://lists.gnu.org/archive/html/help-gnu-emacs/2015-02/msg00381.html.
>
> To reproduce:
>
> $ emacs -Q -batch -eval '(error "foo")' < /dev/null ; echo $?
> foo
> 255
>
> $ emacs -Q -batch -eval '(kill-emacs 37)' < /dev/null ; echo $?
> 37
>
> $ emacs -Q -batch -eval '(progn (ignore-errors (read)) (kill-emacs 37))' <<< nil ; echo $?
> Lisp _expression_: 37
>
> $ emacs -Q -batch -eval '(read)' < /dev/null ; echo $?
> Lisp _expression_: Error reading from stdin
> 0
>
> $ emacs -Q -batch -eval '(progn (ignore-errors (read)) (kill-emacs 37))' < /dev/null ; echo $?
> Lisp _expression_: 0
>
> The examples with nonzero exit code are as expected.  The examples with
> zero exit code are unexpected.  They are caused by the code
>
>   if (feof (stdin))
>     arg = Qt;
>
> in Fkill_emacs.  This behavior confuses e.g. unit tests runners that
> rely on a precise exit code.
> It is not documented in the documentation for kill-emacs.

Fixed in commit 7932d06 on master branch.

Thanks for the speedy fix. Confirming that this fixes my problem. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]