[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()
- To: "Sean C. Farley" <scf_(_at_)_FreeBSD_(_dot_)_org>
- Subject: Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- From: Andrey Chernov <ache_(_at_)_nagual_(_dot_)_pp_(_dot_)_ru>
- Date: Sat, 7 Jul 2007 17:09:00 +0400
- Cc: freebsd-current <freebsd-current_(_at_)_FreeBSD_(_dot_)_org>, Robert Watson <rwatson_(_at_)_FreeBSD_(_dot_)_org>, Michal Mertl <mime_(_at_)_traveller_(_dot_)_cz>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nagual.pp.ru; s=default; t=1183813741; bh=L/fEMjnQqfRykm7C6vfVC5AO0IwRS5pgfUHyb9F mBnc=; l=1366; h=Received:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=aa5EPsa90G2ApBjsl789 BvEb1NYZqESV8jlaS8TI2NtkcUTNIfPdFtrh6xTzUHbrPKXXpn8VKdhNzA1UqJ+thNJ aq5IZ6zpINKIgvh+/Ad6JRXKfTUSDfXRFsYxS6nMJzf2K3dATlDXpLD2hyhFSK/oUUz DFe0yd4JSqA5RyVGM=
- Mail-followup-to: Andrey Chernov <ache_(_at_)_nagual_(_dot_)_pp_(_dot_)_ru>, "Sean C. Farley" <scf_(_at_)_FreeBSD_(_dot_)_org>, Robert Watson <rwatson_(_at_)_FreeBSD_(_dot_)_org>, freebsd-current <freebsd-current_(_at_)_FreeBSD_(_dot_)_org>, Michal Mertl <mime_(_at_)_traveller_(_dot_)_cz>
On Thu, Jul 05, 2007 at 11:38:53AM -0500, Sean C. Farley wrote:
>> Previously the goal of veryfy_env() is just deactivate, the goal of
>> build_env() is just build. It was build_env() who insetrts new environ
>> variables into envVars array in old variant, isn't?
>
> Yes, it was. Now, it is to merge in a new environ array. I renamed it
> __merge_environ() to better reflect its new role.
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.
> The alternative, which I had actually considered, is to split setenv()
> into __setenv() which is almost the entire current setenv() and a new
> setenv() that is just a wrapper around __setenv() with the beginning
> checks. This seems a bit of a waste, but I may be mistaken.
Well, no recurse level increase problems but just slowdown.
--
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"
- References:
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
- Re: Environment handling broken in /bin/sh with changes to {get,set,put}env()
Visit your host, monkey.org