phc2sys.c: Sync variable 'node.sanity_freq_limit with cfg item

Copy 'node.sanity_freq_limit' to struct config item 'sanity_freq_limit'.
Check for 'servo_type' == CLOCK_SERVO_NTPSHM.

Signed-off-by: Peter Schneider <peter@psch.de>
master
Peter Schneider 2018-04-15 21:13:54 +02:00 committed by Richard Cochran
parent c22864a807
commit 26308c219a
1 changed files with 5 additions and 2 deletions

View File

@ -1349,7 +1349,6 @@ int main(int argc, char *argv[])
int ntpshm_segment; int ntpshm_segment;
double phc_rate, tmp; double phc_rate, tmp;
struct node node = { struct node node = {
.sanity_freq_limit = 200000000,
.phc_readings = 5, .phc_readings = 5,
.phc_interval = 1.0, .phc_interval = 1.0,
}; };
@ -1445,8 +1444,10 @@ int main(int argc, char *argv[])
node.forced_sync_offset = -1; node.forced_sync_offset = -1;
break; break;
case 'L': case 'L':
if (get_arg_val_i(c, optarg, &node.sanity_freq_limit, 0, INT_MAX)) if (get_arg_val_i(c, optarg, &node.sanity_freq_limit, 0, INT_MAX) ||
config_set_int(cfg, "sanity_freq_limit", node.sanity_freq_limit)) {
goto end; goto end;
}
break; break;
case 'M': case 'M':
if (get_arg_val_i(c, optarg, &ntpshm_segment, INT_MIN, INT_MAX) || if (get_arg_val_i(c, optarg, &ntpshm_segment, INT_MIN, INT_MAX) ||
@ -1548,8 +1549,10 @@ int main(int argc, char *argv[])
node.servo_type = config_get_int(cfg, NULL, "clock_servo"); node.servo_type = config_get_int(cfg, NULL, "clock_servo");
if (node.servo_type == CLOCK_SERVO_NTPSHM) { if (node.servo_type == CLOCK_SERVO_NTPSHM) {
config_set_int(cfg, "kernel_leap", 0); config_set_int(cfg, "kernel_leap", 0);
config_set_int(cfg, "sanity_freq_limit", 0);
} }
node.kernel_leap = config_get_int(cfg, NULL, "kernel_leap"); node.kernel_leap = config_get_int(cfg, NULL, "kernel_leap");
node.sanity_freq_limit = config_get_int(cfg, NULL, "sanity_freq_limit");
if (autocfg) { if (autocfg) {
if (init_pmc(cfg, &node)) if (init_pmc(cfg, &node))