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

Rainer Weikusat rainer.weikusat at sncag.com
Tue Jul 26 11:25:30 MDT 2005


Shaun Jackman <sjackman at gmail.com> writes:
> On 7/26/05, Rainer Weikusat <rainer.weikusat at sncag.com> wrote:
>> > +     if (CONFIG_FEATURE_CLEAN_UP) close(sockfd);
>> >       return goterr;
>> >  }
>> 
>> What is this supposed to accomplish, besides inflating the binary for
>> no reason?
>
> If CLEAN_UP is undefined, it shouldn't affect the binary size at
> all.

This depends on the compiler that is used and on the way it is
called, ie this is a really ugly hack. Actually, it even (assuming
gcc) depends on undocumented features of this compiler.

> If CLEAN_UP is defined, it cleans up the resources the applet has
> allocated, namely file descriptors in this case.

'ifconfig' is not supposed to be a "long running program", therefore,
it is sufficent to have the kernel close the descriptor after the
program exits.


More information about the busybox mailing list