unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 19897-done@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAArVCkQit8xgiijk3WFXEG34A31gbX=p-nAEw9KzAbFUgJ=v_Q@mail.gmail.com> (raw)
In-Reply-To: <wvr4wq3fym0t.fsf@phst2.muc.corp.google.com>

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 2037 bytes --]

      reply	other threads:[~2015-02-19 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 20:58 bug#19897: 24.3; Emacs exits with exit code 0 if EOF of stdin has been reached Philipp Stephani
2015-02-18 21:16 ` Eli Zaretskii
2015-02-19 11:47   ` Philipp Stephani [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAArVCkQit8xgiijk3WFXEG34A31gbX=p-nAEw9KzAbFUgJ=v_Q@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=19897-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).