diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-15 20:03:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-15 20:03:36 +0000 |
commit | 9f7b92a2e13b184b1d6f7d9fbddc133666224bcf (patch) | |
tree | 44fec109468bd6f954e01ca192b289b6fb1ce7d8 | |
parent | 384b1d12f957a3a4c80fb32bc29cb79c282ac361 (diff) | |
download | busybox-w32-9f7b92a2e13b184b1d6f7d9fbddc133666224bcf.tar.gz busybox-w32-9f7b92a2e13b184b1d6f7d9fbddc133666224bcf.tar.bz2 busybox-w32-9f7b92a2e13b184b1d6f7d9fbddc133666224bcf.zip |
dhcpd: make -S and -f actually work
-rw-r--r-- | include/usage.h | 1 | ||||
-rw-r--r-- | networking/udhcp/dhcpd.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/usage.h b/include/usage.h index d9e2857e8..e2686a2b4 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -3676,6 +3676,7 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when | |||
3676 | "[-fS] [configfile]" \ | 3676 | "[-fS] [configfile]" \ |
3677 | 3677 | ||
3678 | #define udhcpd_full_usage \ | 3678 | #define udhcpd_full_usage \ |
3679 | "DHCP server" \ | ||
3679 | "\n -f Stay in foreground" \ | 3680 | "\n -f Stay in foreground" \ |
3680 | "\n -S Log to syslog too" | 3681 | "\n -S Log to syslog too" |
3681 | 3682 | ||
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index d8e80e30d..fb42e2f73 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -37,6 +37,7 @@ int udhcpd_main(int argc, char **argv) | |||
37 | struct dhcpOfferedAddr *lease, static_lease; | 37 | struct dhcpOfferedAddr *lease, static_lease; |
38 | 38 | ||
39 | opt = getopt32(argc, argv, "fS"); | 39 | opt = getopt32(argc, argv, "fS"); |
40 | argv += optind; | ||
40 | 41 | ||
41 | if (!(opt & 1)) { /* no -f */ | 42 | if (!(opt & 1)) { /* no -f */ |
42 | bb_daemonize_or_rexec(0, argv); | 43 | bb_daemonize_or_rexec(0, argv); |
@@ -50,7 +51,7 @@ int udhcpd_main(int argc, char **argv) | |||
50 | 51 | ||
51 | /* Would rather not do read_config before daemonization - | 52 | /* Would rather not do read_config before daemonization - |
52 | * otherwise NOMMU machines will parse config twice */ | 53 | * otherwise NOMMU machines will parse config twice */ |
53 | read_config(argv[1] ? argv[1] : DHCPD_CONF_FILE); | 54 | read_config(argv[0] ? argv[0] : DHCPD_CONF_FILE); |
54 | 55 | ||
55 | /* Make sure fd 0,1,2 are open */ | 56 | /* Make sure fd 0,1,2 are open */ |
56 | bb_sanitize_stdio(); | 57 | bb_sanitize_stdio(); |