docs/logging_and_backgrounding.txt: new mini-doc
[oweals/busybox.git] / networking / udhcp / dhcpc.c
index 115cddbf0fbfbc9f2f996680cb441f5951011667..e9f99e39c83e8d18573638cab3f2ec06e70b9831 100644 (file)
@@ -280,11 +280,11 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
        /* on NOMMU reexec (i.e., background) early */
        if (!(opt & OPT_f)) {
                bb_daemonize_or_rexec(0 /* flags */, argv);
-               logmode = 0;
+               logmode = LOGMODE_NONE;
        }
 #endif
        if (opt & OPT_S) {
-               openlog(applet_name, LOG_PID, LOG_LOCAL0);
+               openlog(applet_name, LOG_PID, LOG_DAEMON);
                logmode |= LOGMODE_SYSLOG;
        }
 
@@ -324,7 +324,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
         * "continue" statements in code below jump to the top of the loop.
         */
        for (;;) {
-               unsigned timestamp_before_wait;
+               /* silence "uninitialized!" warning */
+               unsigned timestamp_before_wait = timestamp_before_wait;
 
                //bb_error_msg("sockfd:%d, listen_mode:%d", sockfd, listen_mode);
 
@@ -441,7 +442,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
                                 * try to find DHCP server using broadcast */
                                if (timeout > 0) {
                                        /* send a request packet */
-                                       send_renew(xid, 0 /* INADDR_ANY*/, requested_ip); /* broadcast */
+                                       send_renew(xid, 0 /*INADDR_ANY*/, requested_ip); /* broadcast */
                                        timeout >>= 1;
                                        continue;
                                }