author | Brian Utterback <brian.utterback@oracle.com> |
Wed, 29 Apr 2015 12:54:24 -0700 | |
branch | s11u2-sru |
changeset 4215 | c0c7615b4511 |
permissions | -rw-r--r-- |
4215
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
1 |
This patch can be removed when upgrading to community version that has |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
2 |
NTP bug 2745 fixed. See http://bugzilla.ntp.org/show_bug.cgi?id=2745 |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
3 |
|
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
4 |
--- ntpd/ntp_timer.c |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
5 |
+++ ntpd/ntp_timer.c |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
6 |
@@ -472,7 +472,7 @@ alarming( |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
7 |
# endif |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
8 |
# ifdef DEBUG |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
9 |
if (debug >= 4) |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
10 |
- write(1, msg, strlen(msg)); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
11 |
+ (void)(0 != write(1, msg, strlen(msg))); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
12 |
# endif |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
13 |
} |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
14 |
#endif /* SYS_WINNT */ |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
15 |
@@ -521,11 +521,23 @@ check_leapsec( |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
16 |
* announce the leap event has happened. |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
17 |
*/ |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
18 |
if (lsdata.warped < 0) { |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
19 |
- step_systime(lsdata.warped); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
20 |
- msyslog(LOG_NOTICE, "Inserting positive leap second."); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
21 |
+ if (clock_max_back > 0.0 && |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
22 |
+ clock_max_back < fabs(lsdata.warped)) { |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
23 |
+ step_systime(lsdata.warped); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
24 |
+ msyslog(LOG_NOTICE, "Positive leap second, stepped backward."); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
25 |
+ } else { |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
26 |
+ msyslog(LOG_NOTICE, "Positive leap second, expect slowdown slew soon." |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
27 |
+ " System clock will be inaccurate until it finishes."); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
28 |
+ } |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
29 |
} else if (lsdata.warped > 0) { |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
30 |
- step_systime(lsdata.warped); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
31 |
- msyslog(LOG_NOTICE, "Inserting negative leap second."); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
32 |
+ if (clock_max_fwd > 0.0 && |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
33 |
+ clock_max_fwd < fabs(lsdata.warped)) { |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
34 |
+ step_systime(lsdata.warped); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
35 |
+ msyslog(LOG_NOTICE, "Negative leap second, stepped forward."); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
36 |
+ } else { |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
37 |
+ msyslog(LOG_NOTICE, "Negative leap second, expect speedup slew soon." |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
38 |
+ " System clock will be inaccurate until it finishes."); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
39 |
+ } |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
40 |
} |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
41 |
report_event(EVNT_LEAP, NULL, NULL); |
c0c7615b4511
14932716 SUNBT4031742 /etc/inet/ntp.client should include broadcastclient
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
42 |
lsprox = LSPROX_NOWARN; |