Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: move $ERRNO to the system module
- X-seq: zsh-workers 51300
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: move $ERRNO to the system module
- Date: Thu, 12 Jan 2023 08:47:37 +0000
- Archived-at: <https://zsh.org/workers/51300>
- In-reply-to: <63758-1673479188.568367@mRHO.g-Av.gAfN>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Oliver Kiddle <opk@xxxxxxx>, Zsh workers <zsh-workers@xxxxxxx>
- References: <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.
See
https://unix.stackexchange.com/search?q=user%3A22565+zsh+errno
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.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author