Date: Sat, 14 Jul 2007 12:57:57 -0500 (CDT) From: "Sean C. Farley" <scf@FreeBSD.org> To: Andrey Chernov <ache@nagual.pp.ru> Cc: freebsd-current <freebsd-current@FreeBSD.org> Subject: Re: Environment handling broken in /bin/sh with changes to t,set,put}env() Message-ID: <20070714125346.U27236@thor.farley.org> In-Reply-To: <20070714170328.GA37383@nagual.pp.ru> References: <20070713202433.GA19856@nagual.pp.ru> <20070713203915.GA20270@nagual.pp.ru> <20070713171942.Q26096@thor.farley.org> <20070713224608.GB21695@nagual.pp.ru> <20070713184543.A26096@thor.farley.org> <20070714004116.GA22909@nagual.pp.ru> <20070713200048.X26971@thor.farley.org> <20070714014319.GA24701@nagual.pp.ru> <20070714022638.GA25256@nagual.pp.ru> <20070714080553.I27236@thor.farley.org> <20070714170328.GA37383@nagual.pp.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Jul 2007, Andrey Chernov wrote: > On Sat, Jul 14, 2007 at 10:25:03AM -0500, Sean C. Farley wrote: *snip* >> The new patch is here: >> http://www.farley.org/freebsd/tmp/setenv/clearenv/patch2 > > Ok. > > BTW, I see no needs to duplicate code here: > > rtrnVal = __rebuild_environ(envVarsTotal); > if (rtrnVal == -1) { > savedErrno = errno; > __clean_env(true); > errno = savedErrno; > } > > return (rtrnVal); > > Failure: > savedErrno = errno; > __clean_env(true); > errno = savedErrno; > > return (-1); > > instead of simple: > > rtrnVal = __rebuild_environ(envVarsTotal); > if (rtrnVal == -1) > goto Failure; > > like before in this function. True. I also changed it to: if (__rebuild_environ(envVarsTotal) == 0) return (0); to get rid of the rtrnVal variable. Sean -- scf@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070714125346.U27236>