Use struct config item 'clock_servo' for parameter handling. Copy this to node.servo_type afterwards.
Signed-off-by: Peter Schneider <pe...@psch.de> --- phc2sys.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index ad67438..5b244b2 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -1397,11 +1397,14 @@ int main(int argc, char *argv[]) break; case 'E': if (!strcasecmp(optarg, "pi")) { - node.servo_type = CLOCK_SERVO_PI; + config_set_int(cfg, "clock_servo", + CLOCK_SERVO_PI); } else if (!strcasecmp(optarg, "linreg")) { - node.servo_type = CLOCK_SERVO_LINREG; + config_set_int(cfg, "clock_servo", + CLOCK_SERVO_LINREG); } else if (!strcasecmp(optarg, "ntpshm")) { - node.servo_type = CLOCK_SERVO_NTPSHM; + config_set_int(cfg, "clock_servo", + CLOCK_SERVO_NTPSHM); } else { fprintf(stderr, "invalid servo name %s\n", optarg); @@ -1541,6 +1544,7 @@ 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 (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