public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [opensm] [PATCH 2/2] Do not load configs from the default config file and specified config file
@ 2011-11-10 18:01 Albert Chu
       [not found] ` <1320948100.22519.338.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Albert Chu @ 2011-11-10 18:01 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

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 <chu11-i2BcT+NCU+M@public.gmane.org>
---
 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [opensm] [PATCH 2/2] Do not load configs from the default config file and specified config file
       [not found] ` <1320948100.22519.338.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
@ 2012-01-10 16:26   ` Alex Netes
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Netes @ 2012-01-10 16:26 UTC (permalink / raw)
  To: Albert Chu; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi Al,

On 10:01 Thu 10 Nov     , Albert Chu wrote:
> 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 <chu11-i2BcT+NCU+M@public.gmane.org>
> ---

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-10 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 18:01 [opensm] [PATCH 2/2] Do not load configs from the default config file and specified config file Albert Chu
     [not found] ` <1320948100.22519.338.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
2012-01-10 16:26   ` Alex Netes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox