[BusyBox] The pidof patch from the bug thing.
Rob Landley
rob at landley.net
Tue Jun 7 02:37:06 UTC 2005
On Sunday 05 June 2005 06:48 am, Bernhard Fischer wrote:
> Wrt SINGLE ifdef: I thought to let the user decide whether -s was wanted
> or not (same with -o) in order not to add functionality one might not
> want to have compiled in unconditionally.
> I was not aware that it is generally not desired to make code conditional
> if it only adds an unspecified amount of bytes to busybox. If so, please
> let me know what percentage / number of bytes are the margin,
> approximately.
It's a judgement call. Each config option is a complexity cost, everybody who
builds this thing has to figure out what it means and whether or not they
want it. The size in bytes is also a cost. A config option to save 20 bytes
probably isn't worth it. A config option to save 1000 bytes definitiely is.
In between...
Generally if we're going to have a config option for something at all, I tend
to lean towards "big full-featured version" and "small, simplistic version".
In this case, if you have -o enabled then the overhead of -s is two if
statements, a help entry, and one more option parse. (Definitely not worth a
config entry.) If you want -s without -o you can always cheese your way to
it. (You don't even need awk: for i in `pidof $1`; do echo $i; break; done )
So grouping those together makes sense to me...
> Wrt _..COMPL: They are prepended with an underscore to express that
> they are only private helpers. Regarding the concatenation: yes, i'm
> aware of that. Purpose is to build up a single string depending on which
> features are enabled.
>
> Where should bb_err_msg_and_die() be used? If you are referring to the
> "illegal omit pid value" then i thought that warning about this should
> not be necessary but would only make the object file bigger for no real
> gain.
I was thinking:
} else { fprintf(stderr, "illegal omit pid value (%s)!\n",
+ omits_p->data);
bb_show_usage(); */
+ }
But I have to read through the logic more closely when I have the combination
of time and energy. (Eyes aren't focusing that well right now. Long day.)
Rob
More information about the busybox
mailing list