This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #126229] POSIX::strerror() clears $!
authorDavid Mitchell <davem@iabyn.com>
Tue, 13 Oct 2015 11:12:37 +0000 (12:12 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 13 Oct 2015 11:18:20 +0000 (12:18 +0100)
commit068e3fb46a24909060201961a41f2ab7fb778caf
tree0690a2bf07001f65cd5c97e39874579f21d6033e
parent147f21b5b8054c559a1ffb568dbf310244fa0c91
[perl #126229] POSIX::strerror() clears $!

If POSIX::strerror is passed $! as its arg, then it ends up doing
local $! = $!, which due to a bug in the localisation system, leaves $!
undef even after scope exit.

Work around the bug by assigning $_[0] to a my var first.
ext/POSIX/lib/POSIX.pm
ext/POSIX/t/strerror_errno.t