[Git][NTPsec/ntpsec][master] Simplify the PPS selection logic
Eric S. Raymond
gitlab at mg.gitlab.com
Mon Jan 21 11:07:30 UTC 2019
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
ee8ff57b by Richard Laager at 2019-01-21T11:04:04Z
Simplify the PPS selection logic
If is_pps_driver is false, the left side of the || matches and the
comparison is short-circuited. Thus, on the right side of the ||,
is_pps_driver is guaranteed to be true.
- - - - -
1 changed file:
- ntpd/ntp_proto.c
Changes:
=====================================
ntpd/ntp_proto.c
=====================================
@@ -1924,8 +1924,8 @@ clock_select(void)
*/
if (typepps != NULL && fabs(sys_offset) < 0.4 &&
(!typepps->is_pps_driver ||
- (typepps->is_pps_driver && (sys_prefer !=
- NULL || (typesystem == NULL && sys_minsane == 0))))) {
+ sys_prefer != NULL ||
+ (typesystem == NULL && sys_minsane == 0))) {
typesystem = typepps;
sys_clockhop = 0;
typesystem->new_status = CTL_PST_SEL_PPS;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ee8ff57b0467d4740ef3e24ba11b1cc9002cf76b
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ee8ff57b0467d4740ef3e24ba11b1cc9002cf76b
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190121/4f0a56f9/attachment.html>
More information about the vc
mailing list