[BusyBox] [patch] pidof, make -s optional and add optional -o

Bernhard Fischer rep.nop at aon.at
Tue Mar 15 20:27:05 UTC 2005


On Mon, Mar 14, 2005 at 02:57:26PM +0300, Vladimir N. Oleynik wrote:
>Bernhard,
>
>>>-   } else
>>>-     omits_p->data = strtol(omits_p->data, NULL, 10);
>>>+   }
>>
>>hum? removing that one would hinder me to say
>>pidof init -o 1 (assuming "init" runs at 1)
>>I left that one in.
>
>You, most likely, have not understood idea.
>I did not remove any functionality. It only optimization.
>The omits_p->data already contains data for comparison.
>Otherwise here it is not correct:
>
>>+		/* no, not talking about ppid but deal with usual case (pid) 
>>*/
>>+			snprintf(getppid_str, sizeof(getppid_str), "%ld",
>>+					strtol(omits_p->data, NULL, 10));
>
>must add omits_p->data = getppid_str;
>and bloat:
>sprintf(data , "%ld", strtol()) + compare (*pl == strtol())
>eq to
>compare (*pl == strtol(data))

ashes on /me.

I also ditched this one since we're in a small environment:
->+	if (omits_p->data[0] == '%')
>+		if (!strncmp(omits_p->data, "%PPID", 5)) {

agree?

I'll put it into the BTS tomorrow.

Thanks for your patience!



More information about the busybox mailing list