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

Re: [doc] $ERRNO broken



2016-10-14 16:56:03 +0100, Stephane Chazelas:
> Probably unrelated to the $errnos issue raised recently. It
> looks like $ERRNO no longer works, at least on Debian Linux
> unstable amd64 with today's git code built with gcc 6.1 or gcc
> 4.4 or the zsh-5.2-5 Debian package.
> 
> Same on ubuntu 16.04 (5.1.1). It was fine in Ubuntu 14.04
> (5.0.2).
> 
> $ zsh -c '/; echo $ERRNO'
> zsh:1: permission denied: /
> 
> $ zsh -c 'typeset -p ERRNO
> $
[...]

Actually, it's fine when you *set* it beforehand, and you would
generally want to set it beforehand as in:

zsh -c 'ERRNO=0; /; echo $ERRNO'

or otherwise you wouldn't know what system call the $ERRNO you'd
get is from.

So it's just a documentation issue: the doc should say that
ERRNO should be set (declaring it is not enough) before use.

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author