[openib-general] {PATCH] Some small fixes in osm_ucast_mgr.c
Hal Rosenstock
halr at voltaire.com
Fri Jun 2 04:38:32 PDT 2006
OpenSM/osm_ucast_mgr.c: Small cleanup in terms of dump file
Some small cleanup near old dump file removing: replacing
CL_ASSERT() with debug-unconditional check and then remove check before
freeing.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
---
osm/opensm/osm_ucast_mgr.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
index cb59a7b..6e0d6c6 100644
--- a/osm/opensm/osm_ucast_mgr.c
+++ b/osm/opensm/osm_ucast_mgr.c
@@ -1148,21 +1148,14 @@ osm_ucast_mgr_process(
build and download the switch forwarding tables.
*/
- /* initialize the fdb dump file: */
- if( osm_log_is_active( p_mgr->p_log, OSM_LOG_ROUTING ) )
+ /* remove the old fdb dump file: */
+ if( osm_log_is_active( p_mgr->p_log, OSM_LOG_ROUTING ) && (file_name =
+ (char*)cl_malloc(strlen(p_mgr->p_subn->opt.dump_files_dir) + 10)) )
{
- file_name =
- (char*)cl_malloc(strlen(p_mgr->p_subn->opt.dump_files_dir) + 10);
-
- CL_ASSERT(file_name);
-
strcpy(file_name, p_mgr->p_subn->opt.dump_files_dir);
strcat(file_name, "/osm.fdbs");
-
unlink(file_name);
-
- if (file_name)
- cl_free(file_name);
+ cl_free(file_name);
}
cl_qmap_apply_func( p_sw_guid_tbl,
More information about the general
mailing list