aboutsummaryrefslogtreecommitdiff
path: root/networking/ntpd.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-02-23 14:28:47 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-02-23 14:28:47 +0100
commit16c52a5d7bfdfe7f1b9f86a223623a45c7074fa5 (patch)
tree68a9621d501c1a474674e59230780cada4a41c2e /networking/ntpd.c
parent6111f967f5299d2eb82fb8eb4bf3b3a4272e3f44 (diff)
downloadbusybox-w32-16c52a5d7bfdfe7f1b9f86a223623a45c7074fa5.tar.gz
busybox-w32-16c52a5d7bfdfe7f1b9f86a223623a45c7074fa5.tar.bz2
busybox-w32-16c52a5d7bfdfe7f1b9f86a223623a45c7074fa5.zip
ntpd: increase OPT_qq constant to not collide with -L
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ntpd.c')
-rw-r--r--networking/ntpd.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 206af00c7..1df6476c1 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -255,7 +255,7 @@ enum {
255 OPT_S = (1 << 6), 255 OPT_S = (1 << 6),
256 OPT_l = (1 << 7) * ENABLE_FEATURE_NTPD_SERVER, 256 OPT_l = (1 << 7) * ENABLE_FEATURE_NTPD_SERVER,
257 /* We hijack some bits for other purposes */ 257 /* We hijack some bits for other purposes */
258 OPT_qq = (1 << 8), 258 OPT_qq = (1 << 31),
259}; 259};
260 260
261struct globals { 261struct globals {
@@ -606,7 +606,7 @@ filter_datapoints(peer_t *p)
606 sum = SQRT(sum / NUM_DATAPOINTS); 606 sum = SQRT(sum / NUM_DATAPOINTS);
607 p->filter_jitter = sum > G_precision_sec ? sum : G_precision_sec; 607 p->filter_jitter = sum > G_precision_sec ? sum : G_precision_sec;
608 608
609 VERB3 bb_error_msg("filter offset:%f(corr:%e) disp:%f jitter:%f", 609 VERB3 bb_error_msg("filter offset:%+f(corr:%e) disp:%f jitter:%f",
610 p->filter_offset, x, 610 p->filter_offset, x,
611 p->filter_dispersion, 611 p->filter_dispersion,
612 p->filter_jitter); 612 p->filter_jitter);
@@ -831,7 +831,7 @@ step_time(double offset)
831 for (item = G.ntp_peers; item != NULL; item = item->link) { 831 for (item = G.ntp_peers; item != NULL; item = item->link) {
832 peer_t *pp = (peer_t *) item->data; 832 peer_t *pp = (peer_t *) item->data;
833 reset_peer_stats(pp, offset); 833 reset_peer_stats(pp, offset);
834 //bb_error_msg("offset:%f pp->next_action_time:%f -> %f", 834 //bb_error_msg("offset:%+f pp->next_action_time:%f -> %f",
835 // offset, pp->next_action_time, pp->next_action_time + offset); 835 // offset, pp->next_action_time, pp->next_action_time + offset);
836 pp->next_action_time += offset; 836 pp->next_action_time += offset;
837 } 837 }
@@ -1167,7 +1167,7 @@ select_and_cluster(void)
1167 } 1167 }
1168 G.last_update_peer = p; 1168 G.last_update_peer = p;
1169 keep_old: 1169 keep_old:
1170 VERB3 bb_error_msg("selected peer %s filter_offset:%f age:%f", 1170 VERB3 bb_error_msg("selected peer %s filter_offset:%+f age:%f",
1171 p->p_dotted, 1171 p->p_dotted,
1172 p->filter_offset, 1172 p->filter_offset,
1173 G.cur_time - p->lastpkt_recv_time 1173 G.cur_time - p->lastpkt_recv_time
@@ -1258,7 +1258,7 @@ update_local_clock(peer_t *p)
1258 switch (G.discipline_state) { 1258 switch (G.discipline_state) {
1259 case STATE_SYNC: 1259 case STATE_SYNC:
1260 /* The first outlyer: ignore it, switch to SPIK state */ 1260 /* The first outlyer: ignore it, switch to SPIK state */
1261 VERB3 bb_error_msg("offset:%f - spike detected", offset); 1261 VERB3 bb_error_msg("offset:%+f - spike detected", offset);
1262 G.discipline_state = STATE_SPIK; 1262 G.discipline_state = STATE_SPIK;
1263 return -1; /* "decrease poll interval" */ 1263 return -1; /* "decrease poll interval" */
1264 1264
@@ -1295,7 +1295,7 @@ update_local_clock(peer_t *p)
1295 * is always suppressed, even at the longer poll 1295 * is always suppressed, even at the longer poll
1296 * intervals. 1296 * intervals.
1297 */ 1297 */
1298 VERB3 bb_error_msg("stepping time by %f; poll_exp=MINPOLL", offset); 1298 VERB3 bb_error_msg("stepping time by %+f; poll_exp=MINPOLL", offset);
1299 step_time(offset); 1299 step_time(offset);
1300 if (option_mask32 & OPT_q) { 1300 if (option_mask32 & OPT_q) {
1301 /* We were only asked to set time once. Done. */ 1301 /* We were only asked to set time once. Done. */
@@ -1319,7 +1319,7 @@ update_local_clock(peer_t *p)
1319 } else { /* abs_offset <= STEP_THRESHOLD */ 1319 } else { /* abs_offset <= STEP_THRESHOLD */
1320 1320
1321 if (G.poll_exp < MINPOLL && G.initial_poll_complete) { 1321 if (G.poll_exp < MINPOLL && G.initial_poll_complete) {
1322 VERB3 bb_error_msg("small offset:%f, disabling burst mode", offset); 1322 VERB3 bb_error_msg("small offset:%+f, disabling burst mode", offset);
1323 G.polladj_count = 0; 1323 G.polladj_count = 0;
1324 G.poll_exp = MINPOLL; 1324 G.poll_exp = MINPOLL;
1325 } 1325 }
@@ -1444,7 +1444,7 @@ update_local_clock(peer_t *p)
1444 memset(&tmx, 0, sizeof(tmx)); 1444 memset(&tmx, 0, sizeof(tmx));
1445 if (adjtimex(&tmx) < 0) 1445 if (adjtimex(&tmx) < 0)
1446 bb_perror_msg_and_die("adjtimex"); 1446 bb_perror_msg_and_die("adjtimex");
1447 VERB3 bb_error_msg("p adjtimex freq:%ld offset:%ld constant:%ld status:0x%x", 1447 VERB3 bb_error_msg("p adjtimex freq:%ld offset:%+ld constant:%ld status:0x%x",
1448 tmx.freq, tmx.offset, tmx.constant, tmx.status); 1448 tmx.freq, tmx.offset, tmx.constant, tmx.status);
1449 } 1449 }
1450 1450
@@ -1476,7 +1476,7 @@ update_local_clock(peer_t *p)
1476 /* NB: here kernel returns constant == G.poll_exp, not == G.poll_exp - 4. 1476 /* NB: here kernel returns constant == G.poll_exp, not == G.poll_exp - 4.
1477 * Not sure why. Perhaps it is normal. 1477 * Not sure why. Perhaps it is normal.
1478 */ 1478 */
1479 VERB3 bb_error_msg("adjtimex:%d freq:%ld offset:%ld constant:%ld status:0x%x", 1479 VERB3 bb_error_msg("adjtimex:%d freq:%ld offset:%+ld constant:%ld status:0x%x",
1480 rc, tmx.freq, tmx.offset, tmx.constant, tmx.status); 1480 rc, tmx.freq, tmx.offset, tmx.constant, tmx.status);
1481#if 0 1481#if 0
1482 VERB3 { 1482 VERB3 {
@@ -1484,12 +1484,12 @@ update_local_clock(peer_t *p)
1484 memset(&tmx, 0, sizeof(tmx)); 1484 memset(&tmx, 0, sizeof(tmx));
1485 if (adjtimex(&tmx) < 0) 1485 if (adjtimex(&tmx) < 0)
1486 bb_perror_msg_and_die("adjtimex"); 1486 bb_perror_msg_and_die("adjtimex");
1487 VERB3 bb_error_msg("c adjtimex freq:%ld offset:%ld constant:%ld status:0x%x", 1487 VERB3 bb_error_msg("c adjtimex freq:%ld offset:%+ld constant:%ld status:0x%x",
1488 tmx.freq, tmx.offset, tmx.constant, tmx.status); 1488 tmx.freq, tmx.offset, tmx.constant, tmx.status);
1489 } 1489 }
1490#endif 1490#endif
1491 G.kernel_freq_drift = tmx.freq / 65536; 1491 G.kernel_freq_drift = tmx.freq / 65536;
1492 VERB2 bb_error_msg("update peer:%s, offset:%f, clock drift:%ld ppm", 1492 VERB2 bb_error_msg("update peer:%s, offset:%+f, clock drift:%+ld ppm",
1493 p->p_dotted, G.last_update_offset, G.kernel_freq_drift); 1493 p->p_dotted, G.last_update_offset, G.kernel_freq_drift);
1494 1494
1495 return 1; /* "ok to increase poll interval" */ 1495 return 1; /* "ok to increase poll interval" */
@@ -1633,7 +1633,7 @@ recv_and_process_peer_pkt(peer_t *p)
1633 1633
1634 p->reachable_bits |= 1; 1634 p->reachable_bits |= 1;
1635 if ((MAX_VERBOSE && G.verbose) || (option_mask32 & OPT_w)) { 1635 if ((MAX_VERBOSE && G.verbose) || (option_mask32 & OPT_w)) {
1636 bb_error_msg("reply from %s: reach 0x%02x offset %f delay %f status 0x%02x strat %d refid 0x%08x rootdelay %f", 1636 bb_error_msg("reply from %s: reach 0x%02x offset %+f delay %f status 0x%02x strat %d refid 0x%08x rootdelay %f",
1637 p->p_dotted, 1637 p->p_dotted,
1638 p->reachable_bits, 1638 p->reachable_bits,
1639 datapoint->d_offset, 1639 datapoint->d_offset,
@@ -1660,7 +1660,7 @@ recv_and_process_peer_pkt(peer_t *p)
1660 * drop poll interval one step down. 1660 * drop poll interval one step down.
1661 */ 1661 */
1662 if (fabs(q->filter_offset) >= POLLDOWN_OFFSET) { 1662 if (fabs(q->filter_offset) >= POLLDOWN_OFFSET) {
1663 VERB3 bb_error_msg("offset:%f > POLLDOWN_OFFSET", q->filter_offset); 1663 VERB3 bb_error_msg("offset:%+f > POLLDOWN_OFFSET", q->filter_offset);
1664 goto poll_down; 1664 goto poll_down;
1665 } 1665 }
1666 } 1666 }
@@ -1675,7 +1675,7 @@ recv_and_process_peer_pkt(peer_t *p)
1675 * helps calm the dance. Works best using burst mode. 1675 * helps calm the dance. Works best using burst mode.
1676 */ 1676 */
1677 VERB4 if (rc > 0) { 1677 VERB4 if (rc > 0) {
1678 bb_error_msg("offset:%f POLLADJ_GATE*discipline_jitter:%f poll:%s", 1678 bb_error_msg("offset:%+f POLLADJ_GATE*discipline_jitter:%f poll:%s",
1679 q->filter_offset, POLLADJ_GATE * G.discipline_jitter, 1679 q->filter_offset, POLLADJ_GATE * G.discipline_jitter,
1680 fabs(q->filter_offset) < POLLADJ_GATE * G.discipline_jitter 1680 fabs(q->filter_offset) < POLLADJ_GATE * G.discipline_jitter
1681 ? "grows" : "falls" 1681 ? "grows" : "falls"