---
src/imm/tools/imm_dumper.cc | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/imm/tools/imm_dumper.cc b/src/imm/tools/imm_dumper.cc
index 68071f1..a8b45a5 100644
--- a/src/imm/tools/imm_dumper.cc
+++ b/src/imm/tools/imm_dumper.cc
@@ -392,6 +392,7 @@ static std::map<std::string, std::string> cacheRDNs(
std::list<std::string> classNamesList;
SaImmClassCategoryT classCategory;
SaImmAttrDefinitionT_2** attrs;
+ SaAisErrorT errorCode;
std::map<std::string, std::string> classRDNMap;
if (selectedClassList.empty()) {
@@ -403,19 +404,22 @@ static std::map<std::string, std::string> cacheRDNs(
std::list<std::string>::iterator it = classNamesList.begin();
while (it != classNamesList.end()) {
- saImmOmClassDescriptionGet_2(immHandle, (char*)it->c_str(), &classCategory,
- &attrs);
-
- for (SaImmAttrDefinitionT_2** p = attrs; *p != NULL; p++) {
- if ((*p)->attrFlags & SA_IMM_ATTR_RDN) {
- classRDNMap[*it] = std::string((*p)->attrName);
- break;
+ errorCode = saImmOmClassDescriptionGet_2(immHandle, (char*)it->c_str(),
+ &classCategory, &attrs);
+ if (errorCode != SA_AIS_OK) {
+ std::cerr << "Failed to get the description for " << it->c_str()
+ << " class - exiting, " << errorCode << std::endl;
+ exit(1);
+ } else {
+ for (SaImmAttrDefinitionT_2** p = attrs; *p != NULL; p++) {
+ if ((*p)->attrFlags & SA_IMM_ATTR_RDN) {
+ classRDNMap[*it] = std::string((*p)->attrName);
+ break;
+ }
}
+ /* Avoid memory leaking */
+ saImmOmClassDescriptionMemoryFree_2(immHandle, attrs);
}
-
- /* Avoid memory leaking */
- saImmOmClassDescriptionMemoryFree_2(immHandle, attrs);
-
++it;
}
--
2.7.4
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel