summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger2010-06-04 13:24:50 -0400
committerMike Frysinger2010-06-04 13:24:50 -0400
commit6db13732954b23bd0f6f55c5b3c3941f0547141c (patch)
treefe029f0c5e5908937d37b2657a18d15695f452da
parent6c2406ac861f42536acb76606c90412324a0e733 (diff)
downloadbusybox-6db13732954b23bd0f6f55c5b3c3941f0547141c.zip
busybox-6db13732954b23bd0f6f55c5b3c3941f0547141c.tar.gz
udhcpd: fix daemonize crash on nommu systems
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--networking/udhcp/dhcpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index e484733..043220d 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -305,11 +305,12 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
, &dhcp_verbose
#endif
);
- argv += optind;
if (!(opt & 1)) { /* no -f */
bb_daemonize_or_rexec(0, argv);
logmode = LOGMODE_NONE;
}
+ /* update argv after the possible vfork+exec in daemonize */
+ argv += optind;
if (opt & 2) { /* -S */
openlog(applet_name, LOG_PID, LOG_DAEMON);
logmode |= LOGMODE_SYSLOG;