Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: move $ERRNO to the system module



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