Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 May 2007 02:26:32 +0400
From:      Andrey Chernov <ache@freebsd.org>
To:        "Sean C. Farley" <sean-freebsd@farley.org>
Cc:        Daniel Eischen <deischen@freebsd.org>, arch@freebsd.org
Subject:   Re: HEADS DOWN
Message-ID:  <20070504222632.GA35447@nagual.pp.ru>
In-Reply-To: <20070504213312.GA33163@nagual.pp.ru>
References:  <20070501160645.GA9333@nagual.pp.ru> <20070501135439.B36275@thor.farley.org> <20070502.102822.-957833022.imp@bsdimp.com> <Pine.GSO.4.64.0705021332020.8590@sea.ntplx.net> <20070502183100.P1317@baba.farley.org> <Pine.GSO.4.64.0705022034180.8590@sea.ntplx.net> <20070502230413.Y30614@thor.farley.org> <20070503160351.GA15008@nagual.pp.ru> <20070504085905.J39482@thor.farley.org> <20070504213312.GA33163@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 05, 2007 at 01:33:12AM +0400, Andrey Chernov wrote:
> On Fri, May 04, 2007 at 01:21:50PM -0500, Sean C. Farley wrote:
> >  I believe I check all that you did in your changes.  Mine looks a little
> >  different since some checks were combined for speed (i.e.,
> >  __strleneq()).
> 
> Looking at 
> http://www.farley.org/freebsd/tmp/setenv-8/POSIX/sysenv.c

It seems 
putenv("a=b");
...
putenv("a=c");
can be optimized a bit more.

Currently you always realloc and rebuild_environ on any putenv call.
But 
envVars[envNdx].active = false;
if (envVars[envNdx].putenv)
	__remove_putenv(envNdx);

in putenv() can be just changed to:

if (envVars[envNdx].putenv) {
	envVars[envNdx].name = string;
	return (0);
}
envVars[envNdx].active = false;

(unless I not miss something).

-- 
http://ache.pp.ru/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070504222632.GA35447>