[BusyBox] Re: ifconfig: Clean up. [PATCH]

Rainer Weikusat rainer.weikusat at sncag.com
Tue Jul 26 11:35:38 MDT 2005


Shaun Jackman <sjackman at gmail.com> writes:
> On 7/26/05, Paul Fox <pgf at brightstareng.com> wrote:
>>  > If CLEAN_UP is undefined, it shouldn't affect the binary size at all.
>>  > If CLEAN_UP is defined, it cleans up the resources the applet has
>>  > allocated, namely file descriptors in this case.
>> 
>> and why do we care about closing file descriptors?
>> 
>> perhaps i should just ask the bigger question:  when would one use
>> CONFIG_FEATURE_CLEAN_UP?  why?  is there a busybox configuration where
>> exit-time leaks are an issue?
>
> This makes it possible to use utilities that detect resource leaks by
> checking that at program exit all resources have been deallocated.

A tool that detects a non-existant ressource leak is broken and should
be fixed. No, the fact that MSVC++ is such a tool, too, is not an
excuse. 

> I'll mention that in my case -- even though as far as I know no one
> else is using this -- I'm using a forkless busybox that imitates
> fork/exit using setjmp/longjmp. The upside is that fork is never
> called (woot!); the downside is that you don't get automatic resource
> deallocation by program exit for free.

OIC: Basically, you are using a broken emulation layer and instead of
fixing that, you'd like to have the code everyone else uses account
for the bugs in your broken emulation layer. Why don't you just walk
the descriptor table in exit and close everything that's still open?
That will work reliably will all current and future busybox applets
and required code changes in only one place?




More information about the busybox mailing list