[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()



On Sat, Jul 07, 2007 at 05:09:00PM +0400, Andrey Chernov wrote:
> Well, I see. You try to keep envVars[] between environ switch by that way. 
> 
> But it still look complicated and probably gains nothing. I.e. will be 
> much _faster_ just free envVars[] (but not variables themselfs) and allow 
> build_env() to calloc() new array for envVars and fills it from new 
> environ. It is surely faster than calling setenv() for each variable just 
> for sake of keepeng once allocated envVars[].
> 
> Moreover, environ switch commonly used to switch from large environ to 
> smaller one (or to empty one), so the rest of old envVars[] array would 
> keep unneccessary allocation.

BTW, if you just free(envVars) when environ switch is detected, there is 
no needs to __remove_putenv() (big slowdown) in the __clean_env() too.

-- 
http://ache.pp.ru/
_______________________________________________
freebsd-current_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe_(_at_)_freebsd_(_dot_)_org"