[BusyBox] syslogd -p

Stuart Hughes stuarth at freescale.com
Wed Jul 6 07:58:59 UTC 2005


Bernhard Fischer wrote:
> On Tue, Jul 05, 2005 at 05:11:29PM +0100, Stuart Hughes wrote:
> 
>>I've attached a patch against busybox-1.00 that implements this.
>>
>>Regards, Stuart
>>
> 
> 
>>diff --exclude CVS -uNr busybox-1.00/sysklogd/syslogd.c busybox-1.00.modified/sysklogd/syslogd.c
>>--- busybox-1.00/sysklogd/syslogd.c	2004-09-14 19:12:13.000000000 +0100
>>+++ busybox-1.00.modified/sysklogd/syslogd.c	2005-07-05 17:05:44.000000000 +0100
>>@@ -623,7 +623,7 @@
>>	char *p;
>>
>>	/* do normal option parsing */
>>-	while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:LC::")) > 0) {
>>+	while ((opt = getopt(argc, argv, "m:nO:s:p:Sb:R:LC::")) > 0) {
> 
> 
> This looks like it would permit p: even if
> CONFIG_FEATURE_SYSLOG_SOCKET_FILE wasn't set.
> 
> I'd
> #define OPT_p "p:"
> conditionally..
> 
> 

Hi Bernhard,

Although the string would allow this in getopt, the #ifdef in the case 
statement means it falls through to the usage message if you try and 
CONFIG_FEATURE_SYSLOG_SOCKET_FILE is not defined.

I looked at the other options that have conditionals and they're done in 
this way, so I thought I'd stay with the existing style.

Regards, Stuart













More information about the busybox mailing list