Skip to contentSkip to conversation

osm_db_files.c: Add osm_db_domain_init failure handling into test program

PATCH New Hal Rosenstock 1 participant 1 message Sep 12, 2013 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 osm_db_files.c: Add osm_db_domain_init failure handling into test program

Also, improve error 6100 log message

---

opensm/osm_db_files.c +6 -1
index 9219722..10389da 100644
@@ -162,7 +162,8 @@ int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log)
 
 	p_db_imp = malloc(sizeof(osm_db_imp_t));
 	if (!p_db_imp) {
-		OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6100: No memory.\n");
+		OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6100: "
+			"Failed to allocate db memory\n");
 		return -1;
 	}
 
@@ -668,6 +669,10 @@ int main(int argc, char **argv)
 	}
 
 	p_dbd = osm_db_domain_init(&db, "lid_by_guid");
+	if (!p_dbd) {
+		printf("db domain init failed\n");
+		exit(1);
+	}
 
 	if (osm_db_restore(p_dbd)) {
 		printf("failed to restore\n");

--
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