PATCH: netstat '-p' optional feature

Denys Vlasenko vda.linux at googlemail.com
Mon Jul 28 07:54:35 UTC 2008


On Mon, Jul 28, 2008 at 3:35 AM, L. Gabriel Somlo <somlo at cmu.edu> wrote:
> On Sun, Jul 27, 2008 at 02:07:29PM +0200, Denys Vlasenko wrote:
>>
>> See attached patch where these (and some more) are fixed.
>>
>
> That looks great to me. Only question is about the following section:
>
>> #define PROGNAME_WIDTH     20
>> #define PROGNAME_WIDTH_STR "20"
>> /* PROGNAME_WIDTH chars: 12345678901234567890 */
>> #define PROGNAME_BANNER "PID/Program name    "
>>
>> struct prg_node {
>>     struct prg_node *next;
>>     long inode;
>>     char name[PROGNAME_WIDTH];
>> };
>>
>> #define PRG_HASH_SIZE 211
>
> Don't you want to wrap it in #if ENABLE_FEATURE_NETSTAT_PRG ? I don't
> think the compiler would care either way, but everything else -p
> related is wrapped like that... :)

You are correct - extra definitions won't matter
as long as code is ifdefed out. The less #if/#endif pairs
are there, the better (for readability).

> Otherwise, if you'd apply it, I'd be very happy :)

Applied, with 1k of shrinkage on top of it. Please try current svn.
--
vda



More information about the busybox mailing list