[ofa-general] [PATCH] opensm/console: dump_portguid - don't duplicate matched guids

Sasha Khapyorsky sashak at voltaire.com
Tue Feb 17 10:51:09 PST 2009


Don't repeat port GUIDs when more then one regular expression matches.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_console.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_console.c b/opensm/opensm/osm_console.c
index 0f26e51..0c3cdbf 100644
--- a/opensm/opensm/osm_console.c
+++ b/opensm/opensm/osm_console.c
@@ -1285,9 +1285,11 @@ static void dump_portguid_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
 		     p_regexp = p_regexp->next)
 			if (regexec
 			    (&(p_regexp->exp), p_port->p_node->print_desc, 0,
-			     NULL, 0) == 0)
+			     NULL, 0) == 0) {
 				fprintf(output, "0x%" PRIxLEAST64 "\n",
 					cl_ntoh64(p_port->p_physp->port_guid));
+				break;
+			}
 	}
 
 	CL_PLOCK_RELEASE(p_osm->sm.p_lock);
-- 
1.6.1.2.319.gbd9e




More information about the general mailing list