Subject: Re: lib/35403: Error code path optimization in libc's implementation of uname()
To: None <netbsd-bugs@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 01/15/2007 23:40:42
Martin Husemann wrote:
> On Thu, Jan 11, 2007 at 01:50:00AM +0000, Pierre Pronchery wrote:
> >  It would be even more efficient to directly return in case of
> > errors in this function, since it can make up to four useless other
> > calls to sysctl() in this situation.
> 
> I could see a point doing this for the first sysctl - but if we touch the
> utsname argument, we should not leave it half-initialized, IMHO.

I've comitted my variant (goto error instead of immediate return -1). The
previous code didn't clear utsname on error either. If you want to add this
please go ahead.

-- 
Christian