On Tue, 18 Feb 2014, Mark Kettenis wrote:
> > Date: Tue, 18 Feb 2014 17:01:24 +0100
> > From: Ingo Schwarze <schwa...@usta.de>
> >
> > > So: we need to
> > >  - clear errno in the success and "no match" cases,
> > 
> > This is incorrect and shouldn't be done.
> > When no error occurs, errno has to stay as it is.
> 
> Indeed.  POSIX explicitly says:
> 
>   "No function in this volume of POSIX.1-2008 shall set errno to zero."
> 
> The standard is slightly ambiguous on what getpwnam_r() should do, but
> the way I read it, it should not touch errno at all.  So it should
> save errno at the start of the function, and restore it just before
> return.

I guess I'll add "review the ports that use getpwnam() and getpwnam_r() 
for correctness" to my todo list as a dependency for this patch then.

Who's filing the bugs with Solaris and glibc, so that we don't have to 
push this boulder upstream against them?


Philip

Reply via email to