Use struct config item 'kernel_leap' for parameter handling. Copy this to node.kernel_leap afterwards. Check for 'servo_type' == CLOCK_SERVO_NTPSHM.
Signed-off-by: Peter Schneider <pe...@psch.de> --- phc2sys.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index 5b244b2..0d7a10c 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -1470,7 +1470,9 @@ int main(int argc, char *argv[]) } break; case 'x': - node.kernel_leap = 0; + if (config_set_int(cfg, "kernel_leap", 0)) { + goto end; + } break; case 'z': if (strlen(optarg) > MAX_IFNAME_SIZE) { @@ -1544,7 +1546,12 @@ int main(int argc, char *argv[]) print_set_verbose(config_get_int(cfg, NULL, "verbose")); print_set_syslog(config_get_int(cfg, NULL, "use_syslog")); print_set_level(config_get_int(cfg, NULL, "logging_level")); + node.servo_type = config_get_int(cfg, NULL, "clock_servo"); + if (node.servo_type == CLOCK_SERVO_NTPSHM) { + config_set_int(cfg, "kernel_leap", 0); + } + node.kernel_leap = config_get_int(cfg, NULL, "kernel_leap"); if (autocfg) { if (init_pmc(cfg, &node)) -- 2.14.3 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel