From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.bugs Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Date: Sat, 17 Sep 2022 16:16:42 +0200 Message-ID: References: <83a66z4m9o.fsf@gnu.org> <83fsgq3517.fsf@gnu.org> <83illm14vt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000596d0105e8e021c1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12031"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57854@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 17 16:18:43 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oZYeY-0002xO-O5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 16:18:42 +0200 Original-Received: from localhost ([::1]:58586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZYeX-0007pm-4D for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 10:18:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZYdv-0007pc-2y for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZYdu-0000HL-QY for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZYdu-0000Xk-Cc for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 14:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57854-submit@debbugs.gnu.org id=B57854.16634242252014 (code B ref 57854); Sat, 17 Sep 2022 14:18:02 +0000 Original-Received: (at 57854) by debbugs.gnu.org; 17 Sep 2022 14:17:05 +0000 Original-Received: from localhost ([127.0.0.1]:46906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYcy-0000WQ-Pe for submit@debbugs.gnu.org; Sat, 17 Sep 2022 10:17:05 -0400 Original-Received: from mail-ed1-f52.google.com ([209.85.208.52]:40887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYct-0000Vp-F0 for 57854@debbugs.gnu.org; Sat, 17 Sep 2022 10:17:03 -0400 Original-Received: by mail-ed1-f52.google.com with SMTP id w28so11356441edi.7 for <57854@debbugs.gnu.org>; Sat, 17 Sep 2022 07:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=04zbojRiiS+X0eoNFsrciRmmSPXiOuGRBw/r1+ZTOjc=; b=BABGYGv7qy1hVpRvDZuMa1ibH6/5MgnHmCB12lkPBWMJB6nvJ3fezNQUqS1VEZA8HY DX4EclRKpKAjIgZv4VzEv7kUDp9cwwAxXurj9F/EM7WleAf7E8rOaUsbDUUihwz4hYv1 wpAdhikORj/0K+dATdu8tyd//VtDlx3++yDr4pELRsc4f5yHFBZsxKHhov7mvSNjv5KL Mv9efNs32TQjrn8UauKbC0DTEN+PHIbw2GN0BcoAwHd3IAtA4sQ7OUlIZXEz2K55tnj1 2CaqSjzx2SYCwQDKxfonbF6AUFB3HXdYEF/jZXeeoUOTNsAuZFDVwpQ8hHHKF6ght3hN BQeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=04zbojRiiS+X0eoNFsrciRmmSPXiOuGRBw/r1+ZTOjc=; b=aZChKwtMSKP1s6hsqU60gAqn6Ma5k8YfMuvntmNNYuzHh5tUbKJDJtpecVPiZQ2EFO 2U3zZ7M3rZPkNnJyyRTprsC18doKObR4RaV7AtRUQNTIcCQ16YAWDyaKXUaPw/zU84vO OBK2IGzAMzLpqs4B3Gvth+sJhh7yKWXGnZ3chg00Tss1MZd2k17tgkQ7wAnBNDlOl2iq BHw9jjE5qQpQVw5tRrno6Lo3fpmohe555w91NpwIbwb532O2GiM4SY2W52w0dGx1hUyi 3DRvWS3aI5GOqwKJmDW1gceViJp7XVzDiK+nZpZME/ew2rwwk96qDcOUTPnb+BbLqLJO Dpjw== X-Gm-Message-State: ACrzQf2etfJP8TBjcmefW3CCvTKudHHy0UdPNQKzMhif+LdnYZXUsbSf 6v7KY1EOiqovw1S52PwPXK+OYE50I6W4XFy25veszG58 X-Google-Smtp-Source: AMsMyM7Ub0KkH5h+tJdpB4iwa+x35mqkU1cm1MIwjS1iNxRwvopZvbY5pPI+UXSwE8RRwzFyKjLkqKCDYhdTcM4waNo= X-Received: by 2002:a05:6402:e98:b0:44d:c2e0:d8b0 with SMTP id h24-20020a0564020e9800b0044dc2e0d8b0mr7836038eda.165.1663424213378; Sat, 17 Sep 2022 07:16:53 -0700 (PDT) In-Reply-To: <83illm14vt.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242874 Archived-At: --000000000000596d0105e8e021c1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah yes, you are totally right (I probably looked over it because I, previously, did not understand its meaning/consequences). Using start-process will be fine (setting a sentinel is not too complicated). Thanks (again) for your help! On Sat, 17 Sept 2022 at 15:56, Eli Zaretskii wrote: > > From: dalanicolai > > Date: Sat, 17 Sep 2022 15:37:08 +0200 > > Cc: 57854@debbugs.gnu.org > > > > Indeed, when invoking the command from the shell prompt using /dev/null > as input > > (pdftocio ... < /dev/null), then the command does not return an error > (i.e. exit code is 0). > > > > So, indeed there is a difference between invoking it from Emacs and > invoking it from the > > shell prompt (without the /dev/null input). This might not be considere= d > a bug, but it is not > > trivial to me, that using call-process implies sending the null-device > as input. > > > > Is there a way to call a process from elisp, without sending the input? > > You could use start-process instead, and then wait for the process to > finish. It would complicate the Lisp program, though. > > > Otherwise, I would > > probably change this into a 'documentation bug' report, in the sense > that it would be nice > > if this detail was mentioned in the docs (I think it is not currently). > > The doc string of call-process already says that: > > The program=E2=80=99s input comes from file INFILE (nil means =E2=80=98n= ull-device=E2=80=99). > --000000000000596d0105e8e021c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah yes, you are totally right (I probably looked over= it because I,
previously, did not understand its meaning/consequ= ences).

Using start-process will be fine (setting = a sentinel is not too complicated).

Thanks (again)= for your help!



On Sat, 17 Sept 2022= at 15:56, Eli Zaretskii <eliz@gnu.org> wrote:
&g= t; From: dalanicolai <dalanicolai@gmail.com>
> Date: Sat, 17 Sep 2022 15:37:08 +0200
> Cc: 57854@d= ebbugs.gnu.org
>
> Indeed, when invoking the command from the shell prompt using /dev/nul= l as input
>=C2=A0 (pdftocio ... < /dev/null), then the command does not return = an error (i.e. exit code is 0).
>
> So, indeed there is a difference between invoking it from Emacs and in= voking it from the
> shell prompt (without the /dev/null input). This might not be consider= ed a bug, but it is not
> trivial to me, that using call-process implies sending the null-device= as input.
>
> Is there a way to call a process from elisp, without sending the input= ?

You could use start-process instead, and then wait for the process to
finish.=C2=A0 It would complicate the Lisp program, though.

> Otherwise, I would
> probably change this into a 'documentation bug' report, in the= sense that it would be nice
> if this detail was mentioned in the docs (I think it is not currently)= .

The doc string of call-process already says that:

=C2=A0The program=E2=80=99s input comes from file INFILE (nil means =E2=80= =98null-device=E2=80=99).
--000000000000596d0105e8e021c1--