From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
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
Message-ID:
References:
<83twyi539j.fsf@gnu.org>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c3fc3cf9247a050f6f7f0c
X-Trace: ger.gmane.org 1424346499 29285 80.91.229.3 (19 Feb 2015 11:48:19 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 19 Feb 2015 11:48:19 +0000 (UTC)
Cc: 19897-done@debbugs.gnu.org
To: Eli Zaretskii
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 19 12:48:14 2015
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
by plane.gmane.org with esmtp (Exim 4.69)
(envelope-from )
id 1YOPaW-00028d-Lv
for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2015 12:48:12 +0100
Original-Received: from localhost ([::1]:55841 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1YOPaV-0005I9-TZ
for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2015 06:48:11 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53848)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1YOPaR-0005Gw-Jo
for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 06:48:08 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1YOPaM-000664-Nz
for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 06:48:07 -0500
Original-Received: from debbugs.gnu.org ([140.186.70.43]:57180)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1YOPaM-00065x-KF
for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 06:48:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80)
(envelope-from ) id 1YOPaM-00048P-CE
for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 06:48:02 -0500
X-Loop: help-debbugs@gnu.org
In-Reply-To:
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 19 Feb 2015 11:48:02 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 19897
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
Original-Received: via spool by 19897-done@debbugs.gnu.org id=D19897.142434645015853
(code D ref 19897); Thu, 19 Feb 2015 11:48:02 +0000
Original-Received: (at 19897-done) by debbugs.gnu.org; 19 Feb 2015 11:47:30 +0000
Original-Received: from localhost ([127.0.0.1]:48420 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from )
id 1YOPZp-00047d-7e
for submit@debbugs.gnu.org; Thu, 19 Feb 2015 06:47:29 -0500
Original-Received: from mail-la0-f47.google.com ([209.85.215.47]:36010)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from ) id 1YOPZn-00047U-5s
for 19897-done@debbugs.gnu.org; Thu, 19 Feb 2015 06:47:27 -0500
Original-Received: by labgq15 with SMTP id gq15so7081542lab.3
for <19897-done@debbugs.gnu.org>; Thu, 19 Feb 2015 03:47:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:references:from:date:message-id:subject:to:cc
:content-type; bh=4Ug4+seQDRd2sTN7Fe29pMONzJ+0DnQPKu3kJNlNRZU=;
b=Uerg3N5IBW+OBppzJcEoYLCIKDEdmp06Ai3etTsqTMGCsJ+LwPKLJCIAAg3TkOXRPm
vQE98DqiV/tw4kjEDGpkToC9mOb63jyDS305zNZ2GE4omwO5aGODU2r31qTtxqzD1LfS
5z10weAvH1dbcLlC1zTlx6NA1sX/AbTqANIbS/9nWim3YjIOMM+B/Uhg5GWyO/xCV8oi
tQc6+n1OzvzRubND0bSPBeKydgaJGCeP8UgSgpNeXGyzZiNrYxRAf1MpXi79ugHwZ05D
nyzyIzTcGK58ngXXi8Ufk+mCpeZZwpXtxcWjXaXrQsqlhwSBKKAfIqFldgM/yjrFGcqB
M3sA==
X-Received: by 10.112.64.2 with SMTP id k2mr3736459lbs.54.1424346446371; Thu,
19 Feb 2015 03:47:26 -0800 (PST)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 140.186.70.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.bugs:99589
Archived-At:
--001a11c3fc3cf9247a050f6f7f0c
Content-Type: text/plain; charset=UTF-8
Eli Zaretskii schrieb am Wed Feb 18 2015 at 10:16:29 PM:
> > From: Philipp Stephani
> > 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.
--001a11c3fc3cf9247a050f6f7f0c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Eli =
Zaretskii <
eliz@gnu.org> schrieb =
am Wed Feb 18 2015 at 10:16:29 PM:
> F=
rom: 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/h=
elp-gnu-emacs/2015-02/msg00381.html.
>
> To reproduce:
>
> $ emacs -Q -batch -eval '(error "foo")' < /dev/nu=
ll ; echo $?
> foo
> 255
>
> $ emacs -Q -batch -eval '(kill-emacs 37)' < /dev/null ; ech=
o $?
> 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.=C2=A0 The example=
s with
> zero exit code are unexpected.=C2=A0 They are caused by the code
>
>=C2=A0 =C2=A0if (feof (stdin))
>=C2=A0 =C2=A0 =C2=A0arg =3D Qt;
>
> in Fkill_emacs.=C2=A0 This behavior confuses e.g. unit tests runners t=
hat
> 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.=C2=A0<=
/div>
--001a11c3fc3cf9247a050f6f7f0c--