[patch] save ~600B

Bernhard Fischer rep.nop at aon.at
Mon Jun 5 11:48:56 UTC 2006


On Mon, Jun 05, 2006 at 01:04:06PM +0200, walter harms wrote:
>hi bernhard,
>just a minor question.
>Does exit(-1) make sense ? so far i remember the shell expects 0-255.

IMO it does make sense. It it a means to make sure to return ~0, no
matter what return type the shell happens to use.
So, for "the shell" -- which likely happens to use unsigned char -- we
return 255, while we wouldn't have to change all explicit calls to
{_,}exit(255) iff the type would change, for whatever reason.
Makes sense?

If it doesn't, then i'd say "it was already there, thus it's not my fault" :P

cheers,
>re,
> wh
>
>
>Bernhard Fischer wrote:
>>On Sun, Jun 04, 2006 at 08:49:16PM +0200, Bernhard Fischer wrote:
>>>Hi,
>>>
>>>- use bb_msg_... in more places.
>>>
>>>While i think that this patch should be ok, i'd be glad if someone could
>>>look over it (been staring at it for too long).
>>>
>>>TIA,
>>>Bernhard
>>
>>updated version 02e
>>
>>
>>===================================================================
>>--- networking/libiproute/utils.c	(revision 15268)
>>+++ networking/libiproute/utils.c	(working copy)
>>@@ -240,9 +240,9 @@
>> 	exit(-1);
>> }
>> 
>>-void invarg(char *msg, char *arg)
>>+void invarg(const char const *arg, const char const *opt)
>> {
>>-	bb_error_msg("argument \"%s\" is wrong: %s", arg, msg);
>>+	bb_error_msg(bb_msg_invalid_arg, arg, opt);
>> 	exit(-1);
>> }
>> 
>>Index: networking/libiproute/utils.h
>



More information about the busybox mailing list