This patch fix typos in ntpd applet:

1) rename INITIAL_SAMLPES -> INITIAL_SAMPLES

2) do not announce ntp server cmdline switch in case of
FEATURE_NTPD_SERVER is not set

Regards,
   Leonid
Subject: 

Signed-off-by: Leonid Lisovskiy <[email protected]>

diff -urBp busybox.orig/include/usage.src.h busybox/include/usage.src.h
--- busybox.orig/include/usage.src.h	2010-10-20 04:03:30.000000000 +0400
+++ busybox/include/usage.src.h	2010-10-20 22:25:57.000000000 +0400
@@ -2788,7 +2788,7 @@ INSERT
        "Address:    127.0.0.1\n"
 
 #define ntpd_trivial_usage \
-	"[-dnqwl] [-S PROG] [-p PEER]..."
+	"[-dnqw"IF_FEATURE_NTPD_SERVER("l")"] [-S PROG] [-p PEER]..."
 #define ntpd_full_usage "\n\n" \
        "NTP client/server\n" \
      "\nOptions:" \
@@ -2797,7 +2797,9 @@ INSERT
      "\n	-q	Quit after clock is set" \
      "\n	-N	Run at high priority" \
      "\n	-w	Do not set time (only query peers), implies -n" \
+	IF_FEATURE_NTPD_SERVER( \
      "\n	-l	Run as server on port 123" \
+	) \
      "\n	-S PROG	Run PROG after stepping time, stratum change, and every 11 mins" \
      "\n	-p PEER	Obtain time from PEER (may be repeated)" \
 
diff -urBp busybox.orig/networking/ntpd.c busybox/networking/ntpd.c
--- busybox.orig/networking/ntpd.c	2010-10-20 04:03:30.000000000 +0400
+++ busybox/networking/ntpd.c	2010-10-20 22:25:57.000000000 +0400
@@ -49,7 +49,7 @@
 /* High-level description of the algorithm:
  *
  * We start running with very small poll_exp, BURSTPOLL,
- * in order to quickly accumulate INITIAL_SAMLPES datapoints
+ * in order to quickly accumulate INITIAL_SAMPLES datapoints
  * for each peer. Then, time is stepped if the offset is larger
  * than STEP_THRESHOLD, otherwise it isn't; anyway, we enlarge
  * poll_exp to MINPOLL and enter frequency measurement step:
@@ -77,7 +77,7 @@
 
 #define RETRY_INTERVAL  5       /* on error, retry in N secs */
 #define RESPONSE_INTERVAL 15    /* wait for reply up to N secs */
-#define INITIAL_SAMLPES 4       /* how many samples do we want for init */
+#define INITIAL_SAMPLES 4       /* how many samples do we want for init */
 
 /* Clock discipline parameters and constants */
 
@@ -1972,14 +1972,14 @@ int ntpd_main(int argc UNUSED_PARAM, cha
 	idx2peer = xzalloc(sizeof(idx2peer[0]) * cnt);
 	pfd = xzalloc(sizeof(pfd[0]) * cnt);
 
-	/* Countdown: we never sync before we sent INITIAL_SAMLPES+1
+	/* Countdown: we never sync before we sent INITIAL_SAMPLES+1
 	 * packets to each peer.
 	 * NB: if some peer is not responding, we may end up sending
 	 * fewer packets to it and more to other peers.
-	 * NB2: sync usually happens using INITIAL_SAMLPES packets,
+	 * NB2: sync usually happens using INITIAL_SAMPLES packets,
 	 * since last reply does not come back instantaneously.
 	 */
-	cnt = G.peer_cnt * (INITIAL_SAMLPES + 1);
+	cnt = G.peer_cnt * (INITIAL_SAMPLES + 1);
 
 	while (!bb_got_signal) {
 		llist_t *item;
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to