unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: esh-proc test failures
Date: Mon, 22 Aug 2022 12:23:37 -0700	[thread overview]
Message-ID: <ae81e535-04bb-6601-87c7-71957f2b8223@gmail.com> (raw)
In-Reply-To: <838rng9kes.fsf@gnu.org>

On 8/22/2022 11:56 AM, Eli Zaretskii wrote:
>> From: Jim Porter <jporterbugs@gmail.com>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 22 Aug 2022 10:06:36 -0700
>>
>> diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
>> index 2f77f3f497..d5cc3706fd 100644
>> --- a/lisp/eshell/esh-cmd.el
>> +++ b/lisp/eshell/esh-cmd.el
>> @@ -1347,6 +1347,10 @@ eshell-exec-lisp
>>                    (apply func-or-form args)))))
>>           (and result (funcall printer result))
>>           result)
>> +    (eshell-pipe-broken
>> +     ;; 141 is 128 + 13 (the numeric value of SIGPIPE).
>> +     (setq eshell-last-command-status 141)
>> +     nil)
> 
> This is non-portable, I think on two counts:
> 
>   . the assumption that the exit code is the signal number left-shifted
>     by N bits (btw, isn't N = 8, not 7?)
>   . the assumption that SIGPIPE is signal 13 (does Posix mandate that?)
> 
> What do we expect to happen here on MS-Windows and other non-Posix
> platforms, where both of the above assumptions are false?

The only thing that really needs to happen here is that the signal is 
caught so it doesn't bubble up past this point and break things. The 
command status could be anything really, and I'm pretty sure Eshell 
doesn't even allow inspecting this value (yet), since it would only 
occur for a non-last item in a pipeline. (In the future, Eshell could 
offer something like $PIPESTATUS to examine this.)

I could expand the comment to explain that this value is 
somewhat-arbitrary and just designed to match GNU/Linux. Alternately, if 
there's a way to inspect the system's conventions to use here (e.g. 
getting the numeric value of SIGPIPE for the current system), we could 
do that too.



  reply	other threads:[~2022-08-22 19:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166036758418.2203.8730240669199078524@vcs2.savannah.gnu.org>
     [not found] ` <20220813051305.6667BC09BFE@vcs2.savannah.gnu.org>
2022-08-14 18:06   ` esh-proc test failures Lars Ingebrigtsen
2022-08-14 18:44     ` Jim Porter
2022-08-22 17:06       ` Jim Porter
2022-08-22 18:56         ` Eli Zaretskii
2022-08-22 19:23           ` Jim Porter [this message]
2022-08-23  2:27             ` Eli Zaretskii
2022-08-23  3:53               ` Jim Porter
2022-08-23 11:37                 ` Eli Zaretskii
2022-08-23 15:57                   ` Jim Porter
2022-08-23 16:22                     ` Eli Zaretskii
2022-08-23 16:38                       ` Jim Porter
2022-08-30  3:18                         ` Jim Porter
2022-08-30 16:51                           ` Jim Porter
2022-08-30 20:56                             ` Jim Porter
2022-08-31 20:52                               ` Jim Porter

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=ae81e535-04bb-6601-87c7-71957f2b8223@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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).