ptp4l: read configuration file immediately after scanning options

This patch moves the call to read the configuration file until just after
the options have finished parsing. This is for future patches that will allow
configuration file to enable ports with specific settings

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
master
Jacob Keller 2012-08-20 10:57:11 -07:00 committed by Richard Cochran
parent 6157db9ac4
commit a7db3a1c2b
1 changed files with 5 additions and 5 deletions

10
ptp4l.c
View File

@ -203,6 +203,11 @@ int main(int argc, char *argv[])
}
}
if (config && config_read(config, &cfg_settings)) {
fprintf(stderr, "failed to read configuration file\n");
return -1;
}
if (!*nports) {
fprintf(stderr, "no interface specified\n");
usage(progname);
@ -232,11 +237,6 @@ int main(int argc, char *argv[])
return -1;
}
if (config && config_read(config, &cfg_settings)) {
fprintf(stderr, "failed to read configuration file\n");
return -1;
}
print_set_verbose(cfg_settings.verbose);
print_set_syslog(cfg_settings.use_syslog);
print_set_level(cfg_settings.print_level);