diff options
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 89f57bfe8..d8e80e30d 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -32,17 +32,18 @@ int udhcpd_main(int argc, char **argv) | |||
32 | uint32_t server_id_align, requested_align, static_lease_ip; | 32 | uint32_t server_id_align, requested_align, static_lease_ip; |
33 | unsigned timeout_end; | 33 | unsigned timeout_end; |
34 | unsigned num_ips; | 34 | unsigned num_ips; |
35 | unsigned opt; | ||
35 | struct option_set *option; | 36 | struct option_set *option; |
36 | struct dhcpOfferedAddr *lease, static_lease; | 37 | struct dhcpOfferedAddr *lease, static_lease; |
37 | 38 | ||
38 | //Huh, dhcpd don't have --foreground, --syslog options?? TODO | 39 | opt = getopt32(argc, argv, "fS"); |
39 | 40 | ||
40 | if (!ENABLE_FEATURE_UDHCP_DEBUG) { | 41 | if (!(opt & 1)) { /* no -f */ |
41 | bb_daemonize_or_rexec(0, argv); | 42 | bb_daemonize_or_rexec(0, argv); |
42 | logmode &= ~LOGMODE_STDIO; | 43 | logmode &= ~LOGMODE_STDIO; |
43 | } | 44 | } |
44 | 45 | ||
45 | if (ENABLE_FEATURE_UDHCP_SYSLOG) { | 46 | if (opt & 2) { /* -S */ |
46 | openlog(applet_name, LOG_PID, LOG_LOCAL0); | 47 | openlog(applet_name, LOG_PID, LOG_LOCAL0); |
47 | logmode |= LOGMODE_SYSLOG; | 48 | logmode |= LOGMODE_SYSLOG; |
48 | } | 49 | } |