If a config file is specified on the command line, only that config file should be used, it should not be parsed in addition to the default.
Signed-off-by: Albert L. Chu <[email protected]> --- opensm/main.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/opensm/main.c b/opensm/main.c index f7a6d83..3edc52f 100644 --- a/opensm/main.c +++ b/opensm/main.c @@ -660,12 +660,6 @@ int main(int argc, char *argv[]) printf("-------------------------------------------------\n"); printf("%s\n", OSM_VERSION); - osm_subn_set_default_opt(&opt); - - if (osm_subn_parse_conf_file(OSM_DEFAULT_CONFIG_FILE, &opt) < 0) - printf("\nFail to parse config file \'%s\'\n", - OSM_DEFAULT_CONFIG_FILE); - do { next_option = getopt_long_only(argc, argv, short_option, long_option, NULL); @@ -681,7 +675,12 @@ int main(int argc, char *argv[]) optind = 0; /* reset command line */ - if (config_file && osm_subn_parse_conf_file(config_file, &opt) < 0) + if (!config_file) + config_file = OSM_DEFAULT_CONFIG_FILE; + + osm_subn_set_default_opt(&opt); + + if (osm_subn_parse_conf_file(config_file, &opt) < 0) printf("\nFail to parse config file \'%s\'\n", config_file); printf("Command Line Arguments:\n"); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
