udhcpd: add -f "foreground" and -S "syslog" options
udhcpc: add -S "syslog" options remove CONFIG_FEATURE_UDHCP_SYSLOG function old new delta udhcpd_main 1168 1201 +33 udhcpc_main 2414 2425 +11 static.udhcpc_longopts 191 200 +9 qgravechar 112 108 -4 packed_usage 22843 22827 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/2 up/down: 53/-20) Total: 33 bytes
This commit is contained in:
@@ -32,17 +32,18 @@ int udhcpd_main(int argc, char **argv)
|
||||
uint32_t server_id_align, requested_align, static_lease_ip;
|
||||
unsigned timeout_end;
|
||||
unsigned num_ips;
|
||||
unsigned opt;
|
||||
struct option_set *option;
|
||||
struct dhcpOfferedAddr *lease, static_lease;
|
||||
|
||||
//Huh, dhcpd don't have --foreground, --syslog options?? TODO
|
||||
opt = getopt32(argc, argv, "fS");
|
||||
|
||||
if (!ENABLE_FEATURE_UDHCP_DEBUG) {
|
||||
if (!(opt & 1)) { /* no -f */
|
||||
bb_daemonize_or_rexec(0, argv);
|
||||
logmode &= ~LOGMODE_STDIO;
|
||||
}
|
||||
|
||||
if (ENABLE_FEATURE_UDHCP_SYSLOG) {
|
||||
if (opt & 2) { /* -S */
|
||||
openlog(applet_name, LOG_PID, LOG_LOCAL0);
|
||||
logmode |= LOGMODE_SYSLOG;
|
||||
}
|
||||
|
Reference in New Issue
Block a user