From: Sakthivel Samidurai Date: Mon, 23 Mar 2015 21:00:11 +0000 (-0700) Subject: Clean up OCStop in C stack X-Git-Tag: 1.2.0+RC1~1855^2~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8ad9b2c2202732bbf9497cfc2259df49b4a088b;p=platform%2Fupstream%2Fiotivity.git Clean up OCStop in C stack Cleanup OCStop method in the C stack. Remove unnecessary error check. Change-Id: I4a1618c684c685a32f70b3087f08fca0961d3461 Signed-off-by: Sakthivel Samidurai Reviewed-on: https://gerrit.iotivity.org/gerrit/545 Reviewed-by: Sachin Agrawal Tested-by: jenkins-iotivity Reviewed-by: Erich Keane --- diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index c859a15..1c8630f 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -1150,8 +1150,6 @@ exit: */ OCStackResult OCStop() { - OCStackResult result = OC_STACK_ERROR; - OC_LOG(INFO, TAG, PCF("Entering OCStop")); if (stackState == OC_STACK_UNINIT_IN_PROGRESS) @@ -1177,30 +1175,14 @@ OCStackResult OCStop() deleteAllResources(); DeleteDeviceInfo(); CATerminate(); - //CATerminate does not return any error code. It is OK to assign result to OC_STACK_OK. - result = OC_STACK_OK; - - if (result == OC_STACK_OK) - { - // Remove all observers - DeleteObserverList(); - // Remove all the client callbacks - DeleteClientCBList(); - stackState = OC_STACK_UNINITIALIZED; - result = OC_STACK_OK; - } else { - stackState = OC_STACK_INITIALIZED; - result = OC_STACK_ERROR; - } - + // Remove all observers + DeleteObserverList(); + // Remove all the client callbacks + DeleteClientCBList(); // Deinit security blob DeinitOCSecurityInfo(); - - if (result != OC_STACK_OK) { - OC_LOG(ERROR, TAG, PCF("Stack stop error")); - } - - return result; + stackState = OC_STACK_UNINITIALIZED; + return OC_STACK_OK; } /**