---
 src/ntf/ntfimcnd/ntfimcn_imm.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/ntf/ntfimcnd/ntfimcn_imm.c b/src/ntf/ntfimcnd/ntfimcn_imm.c
index 1358d9f..28b71d9 100644
--- a/src/ntf/ntfimcnd/ntfimcn_imm.c
+++ b/src/ntf/ntfimcnd/ntfimcn_imm.c
@@ -152,7 +152,6 @@ static SaAisErrorT getClassDescription(const 
SaImmClassNameT className,
  *
  * Note:
  * Uses in file global struct s_get_rdn_attr_name
- * Uses global immOmHandle in struct ntfimcn_cb_t
  *
  * @param className[in]
  *
@@ -231,19 +230,15 @@ error:
        /* NOTE: Resources are allocated by this function
         *       saImmOmClassDescriptionMemoryFree_2() must be called before
         *       returning from this function. Not done here because of
-        *       osafassert()
+        *       imcn_exit()
         */
        LOG_ER("%s Failed", __FUNCTION__);
        if ( rc == SA_AIS_ERR_NOT_EXIST ) {
-               LOG_NO("osafntfimcnd restarting due to error %s.",
-                       saf_error(rc));
-               _exit(EXIT_FAILURE);
-       }
-       else
-       {
-               // core dump will be generated for all other errors which will 
be used
-               // for further analysis of the error.
-               osafassert(0);
+               LOG_NO("%s: Failed with error %s", __FUNCTION__,saf_error(rc));
+               imcn_exit(EXIT_FAILURE);
+       } else {
+               LOG_NO("osafntfimcnd restarting due to an error.");
+               imcn_exit(EXIT_FAILURE);
        }
        return 0; /* Dummy */
 }
@@ -936,7 +931,7 @@ done:
 static bool initializeImmOmHandle(SaImmHandleT* immOmHandle) {
        struct timespec timeout_ts;
        struct timespec delay_ts;
-       SaAisErrorT ais_rc;
+       SaAisErrorT ais_rc = SA_AIS_OK;
        bool internal_rc = true;
        SaVersionT imm_version = kImmVersion;
 
@@ -946,11 +941,17 @@ static bool initializeImmOmHandle(SaImmHandleT* 
immOmHandle) {
        while (osaf_is_timeout(&timeout_ts) == false) {
                ais_rc = saImmOmInitialize(immOmHandle,
                        &omCallbacks, &imm_version);
-               if (ais_rc != SA_AIS_ERR_TRY_AGAIN) {
+               if (ais_rc == SA_AIS_ERR_TRY_AGAIN) {
+                       osaf_nanosleep(&delay_ts);
+                       imm_version = kImmVersion;
+                       continue;
+               } else if (ais_rc == SA_AIS_ERR_TIMEOUT) {
+                       finalizeImmOmHandle(*immOmHandle);
+                       osaf_nanosleep(&delay_ts);
+                       imm_version = kImmVersion;
+                       continue;
+               } else
                        break;
-               }
-               osaf_nanosleep(&delay_ts);
-               imm_version = kImmVersion;
        }
 
        if (ais_rc != SA_AIS_OK) {
@@ -978,7 +979,7 @@ static void finalizeImmOmHandle(SaImmHandleT immOmHandle) {
        }
 
        if (ais_rc != SA_AIS_OK) {
-               LOG_NO("%s saImmOmInitialize failed %s", __FUNCTION__,
+               LOG_NO("%s saImmOmFinalize failed %s", __FUNCTION__,
                       saf_error(ais_rc));
        }
 }
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to