help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane@chazelas.org>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: move $ERRNO to the system module
Date: Thu, 12 Jan 2023 08:47:37 +0000	[thread overview]
Message-ID: <20230112084737.tq6uppqd7io7bj3v@chazelas.org> (raw)
In-Reply-To: <63758-1673479188.568367@mRHO.g-Av.gAfN>

2023-01-12 00:19:48 +0100, Oliver Kiddle:
> This would not be a strictly backward-compatible change.

Use cases where people go out of their way to check $ERRNO,
would be ones where it matters that errors be checked.

If you move it to a module, then scripts that do:
ERRNO=0; something && ((!ERRNO))
will start to silently ignore errors.

for some use cases of $ERRNO by me.

Note that we need zsh/system to translate ERRNOs to EXXX codes
or error messages, but we don't always need to.

It's true ERRNO is not very reliable though and one should
probably not rely too heavily on it, though in general the
problem is that it reports more errors than you'd like. The
EILSEQs that get in the way when you try to check whether a glob
expansion can be trusted to have found all matches in particular
come to mind.


  reply	other threads:[~2023-01-12  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 23:19 Oliver Kiddle
2023-01-12  8:47 ` Stephane Chazelas [this message]
2023-01-12 17:14 ` Daniel Shahaf
2023-01-16 21:34   ` Bart Schaefer

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:

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

  git send-email \
    --in-reply-to=20230112084737.tq6uppqd7io7bj3v@chazelas.org \
    --to=stephane@chazelas.org \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \


* 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


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 NNTP newsgroup(s).