---
 src/ntf/ntfimcnd/ntfimcn_imm.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/ntf/ntfimcnd/ntfimcn_imm.c b/src/ntf/ntfimcnd/ntfimcn_imm.c
index 1358d9f..8376c45 100644
--- a/src/ntf/ntfimcnd/ntfimcn_imm.c
+++ b/src/ntf/ntfimcnd/ntfimcn_imm.c
@@ -234,17 +234,8 @@ error:
         *       osafassert()
         */
        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("osafntfimcnd restarting due to an error.");
+       imcn_exit(EXIT_FAILURE);
        return 0; /* Dummy */
 }
 
@@ -936,7 +927,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,9 +937,12 @@ 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) {
-                       break;
-               }
+               if (ais_rc == SA_AIS_ERR_TRY_AGAIN)
+                   continue;
+               else if (ais_rc == SA_AIS_ERR_TIMEOUT && immOmHandle == 0)
+                   continue;
+               else
+                   break;
                osaf_nanosleep(&delay_ts);
                imm_version = kImmVersion;
        }
@@ -956,7 +950,7 @@ static bool initializeImmOmHandle(SaImmHandleT* 
immOmHandle) {
        if (ais_rc != SA_AIS_OK) {
                LOG_NO("%s saImmOmInitialize failed %s", __FUNCTION__,
                       saf_error(ais_rc));
-               internal_rc = false;
+                internal_rc = false;
        }
        return internal_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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to