aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpd.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-14 16:45:29 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-14 16:45:29 +0000
commit3d17d2b430a6a68c967b789c990cc441154d695e (patch)
treeb01535085348ea653c1c9d5ef3b525b461c02fc3 /networking/udhcp/dhcpd.c
parentdbe6e66d6a8addbbf9438f40a645be8ae105fa8a (diff)
downloadbusybox-3d17d2b430a6a68c967b789c990cc441154d695e.tar.gz
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
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r--networking/udhcp/dhcpd.c7
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)
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;
}