develooper Front page | perl.perl5.porters | Postings from September 2011

Re: [perl #98934] set{u,g}id doesn't clear $! on success

Thread Previous | Thread Next
From:
Eric Brine
Date:
September 13, 2011 16:18
Subject:
Re: [perl #98934] set{u,g}id doesn't clear $! on success
Message ID:
CALJW-qHYKHdQ+Gkcp5up9bUBTkKVYxtOQxFN1T+A19P80YPP2g@mail.gmail.com
On Tue, Sep 13, 2011 at 8:30 AM, Leon Timmermans <fawaka@gmail.com> wrote:

> > This is highly confusing, and there's really no reason to push this off
> > on the people writing perl code.  At a minimum, perl internally could do
> > something like:
> >
> >    if (setregid(gid,-1) == 0)
> >        errno = 0;
> >
> > (and that goes for all the setuid/setgid family of functions).
>
> That might piss off an equal number of users because $! gets
> overwritten when they didn't expect it.
>

They should be expecting it. System calls are allowed to change $! on
success, since $! isn't meaningful on success.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About