udhcpd: fix daemonize crash on nommu systems

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2010-06-04 13:24:50 -04:00
parent 6c2406ac86
commit 6db1373295

View File

@ -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;