ip link: add VLAN support
[oweals/busybox.git] / networking / ntpd_simple.c
index 5e48306c7f9472fc3e7601e2d3acfa12e989bdcd..3e7fc47199667b73cc4199531ee761d8f5dc8bfa 100644 (file)
@@ -3,10 +3,11 @@
  *
  * Author: Adam Tkac <vonsch@gmail.com>
  *
- * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 #include "libbb.h"
 #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
+#include <sys/resource.h> /* setpriority */
 #ifndef IPTOS_LOWDELAY
 # define IPTOS_LOWDELAY 0x10
 #endif
@@ -377,7 +378,7 @@ step_time_once(double offset)
                bb_perror_msg_and_die("settimeofday");
 
        tval = tv.tv_sec;
-       strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %Z %Y", localtime(&tval));
+       strftime_YYYYMMDDHHMMSS(buf, sizeof(buf), &tval);
 
        bb_error_msg("setting clock to %s (offset %fs)", buf, offset);
 
@@ -709,7 +710,7 @@ recv_and_process_client_pkt(void /*int fd*/)
        msg.m_status = G.synced ? G.leap : LI_ALARM;
        msg.m_status |= (query_status & VERSION_MASK);
        msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ?
-                        MODE_SERVER : MODE_SYM_PAS;
+                       MODE_SERVER : MODE_SYM_PAS;
        msg.m_stratum = G.stratum;
        msg.m_ppoll = query_ppoll;
        msg.m_precision_exp = G_precision_exp;
@@ -870,7 +871,7 @@ static NOINLINE void ntp_init(char **argv)
                int prec = 0;
                int b;
 # if 0
-               struct timespec tp;
+               struct timespec tp;
                /* We can use sys_clock_getres but assuming 10ms tick should be fine */
                clock_getres(CLOCK_REALTIME, &tp);
                tp.tv_sec = 0;