From: dalanicolai <dalanicolai@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 57854@debbugs.gnu.org
Subject: bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process
Date: Sat, 17 Sep 2022 15:37:08 +0200 [thread overview]
Message-ID: <CACJP=3kWie05FLntBKCdJK8+hdiewh6UZuvGtEh+ArmyOiNKOg@mail.gmail.com> (raw)
In-Reply-To: <83fsgq3517.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
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 considered 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?
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). I
am not sure, if this is a
case of a 'bad/wrongly designed' pdftocio command (I would say that the
command might
be well designed, but just it assumes that it is being used from the shell
prompt. However,
I am no expert on unix(/posix?) 'protocols').
On Sat, 17 Sept 2022 at 08:10, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Fri, 16 Sep 2022 21:29:15 +0200
> > Cc: 57854@debbugs.gnu.org
> >
> > I don't understand the answer well (my knowledge about computers is very
> limited),
> > i.e. I do not immediately understand what it means for a file to be a
> tty.
> >
> > But also, I think the isatty() is about the TOC file, i.e. the file
> given as INFILE (after the `<`)
> > But I am not giving any INFILE (which would make the command add the TOC
> to the file given as
> > argument),
> > Instead I simply provide a single filepath as argument so that the
> command simply prints the TOC.
>
> I mentioned that aspect because it could be different between
> invocation from shell prompt and from call-process. I didn't examine
> the Python code of the program more than look at the snipped you
> posted.
>
> Basically, I don't think this is an Emacs problem, because
> call-process faithfully reports the exit code of the program it runs.
> The reason for the different behavior is almost certainly in the
> program itself or in some factor that is different between how you
> invoke it from shell and how you invoked it from Lisp.
>
[-- Attachment #2: Type: text/html, Size: 2860 bytes --]
next prev parent reply other threads:[~2022-09-17 13:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 9:39 bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process dalanicolai
2022-09-16 10:00 ` bug#57854: some extra info from inspecting the `pdftocio` package dalanicolai
2022-09-16 10:39 ` Eli Zaretskii
2022-09-16 19:16 ` dalanicolai
2022-09-16 11:00 ` bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Eli Zaretskii
2022-09-16 19:29 ` dalanicolai
2022-09-16 19:44 ` dalanicolai
2022-09-17 6:10 ` Eli Zaretskii
2022-09-17 13:37 ` dalanicolai [this message]
2022-09-17 13:56 ` Eli Zaretskii
2022-09-17 14:16 ` dalanicolai
2022-09-17 14:42 ` Eli Zaretskii
2022-09-16 10:05 ` bug#57854: Test result to previous suggestion dalanicolai
2022-09-16 10:12 ` bug#57854: good to know dalanicolai
2022-09-16 10:46 ` bug#57854: 29.0.50; Different exit code in Emacs and terminal for identical process Eli Zaretskii
2022-09-16 10:35 ` Eli Zaretskii
[not found] ` <CACJP=3k9N5u1vY9Q2sM9angpcLEA7NMeLiFbvPdFAZfX+XbGYg@mail.gmail.com>
2022-09-17 6:05 ` Eli Zaretskii
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='CACJP=3kWie05FLntBKCdJK8+hdiewh6UZuvGtEh+ArmyOiNKOg@mail.gmail.com' \
--to=dalanicolai@gmail.com \
--cc=57854@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).