syslogd_main & getopt

Bernhard Fischer rep.nop at aon.at
Mon Oct 17 07:30:44 UTC 2005


On Sun, Oct 16, 2005 at 06:00:19PM -0500, Rob Landley wrote:
>On Sunday 16 October 2005 16:25, Cristian Ionescu-Idbohrn wrote:
>> Given the ifdefs below this line:
>>
>>   while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:LC::")) > 0) {
>>
>> shouldn't it be rewritten similar to:
>>
>>   while ((opt = getopt(argc, argv, "m:nO:S"
>> #ifdef CONFIG_FEATURE_ROTATE_LOGFILE
>>                                    "s:b:"
>> #endif
>> #ifdef CONFIG_FEATURE_REMOTE_LOG
>>                                    "R:L"
>> #endif
>> #ifdef CONFIG_FEATURE_IPC_SYSLOG
>>                                    "C::"
>> #endif
>>           )) > 0) {
>>
>> The way it currently behaves is confusing :( Options depending on ifdefs
>> are accepted, although they do nothing useful.
>
>Accepting but ignoring features that are configured out doesn't bother me 

Personally, i dislike options being unavailable to be accepted (Rob, did
you look at the size with those innocent looking bits #ifdef'ed out vs.
having them in and doing nothing but confusing people? I prefer them not
to be accepted if they are not available).

>much.  (It runs about even with having the extra config #ifdefs.  No really 
>strong opinion one way or the other.)
>
>> usage.h needs some attention too. CONFIG_FEATURE_...LOG defines should be
>> moved below the 'sysctl_trivial_usage' block.
>
>The usage definitely needs to be correct, though.
>
>Any word on the status of the proposed #include rework to automate generation 
>of the usage config macros?  (Say _that_ five times fast...)

>From my POV it could go in as is. That said, please check it in and name
the file the way you like.



More information about the busybox mailing list