From: saerome.kim Date: Wed, 24 Jan 2018 06:27:10 +0000 (+0900) Subject: mot-agent: fix problem once companaion-manager died abruptly, we can't 'Eject' device... X-Git-Tag: submit/tizen/20190131.065036~165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41ddd35d18fb0b272f3f02c53ac0c752da9b2b14;p=platform%2Fcore%2Fapi%2Fmulti-device-group.git mot-agent: fix problem once companaion-manager died abruptly, we can't 'Eject' device forever. Signed-off-by: saerome.kim --- diff --git a/src/mot-agent/ma-subowner.c b/src/mot-agent/ma-subowner.c index f78d3e6..2242119 100644 --- a/src/mot-agent/ma-subowner.c +++ b/src/mot-agent/ma-subowner.c @@ -2258,14 +2258,14 @@ static gpointer _unpair_func(gpointer data) owner_uuid = _convert_uuid(con->uuid_dev1); owner_dev = _get_dev_by_uuid(g_client->g_motdev_list, owner_uuid); if (!owner_dev) { - MA_LOGE("We can't find in MOWNED dev list"); + MA_LOGE("We can't find in MOT enabled dev list"); goto PVUNPAIR_ERROR; } owned_uuid = _convert_uuid(con->uuid_dev2); owned_dev = _get_dev_by_uuid(g_client->g_motdev_list, owned_uuid); if (!owned_dev) { - MA_LOGE("We can't find in MOWNED dev list"); + MA_LOGE("We can't find in MOT enabled dev list"); goto PVUNPAIR_ERROR; } @@ -2275,13 +2275,12 @@ static gpointer _unpair_func(gpointer data) ret = OCUnlinkDevices((void*) g_client, owner_dev, owned_dev, _unlink_cb ); if (OC_STACK_OK != ret) { MA_LOGD( "OCUnlinkDevices API error = %d (%s)", ret, _error_to_string(ret)); - goto PVUNPAIR_ERROR; - } - - ret = _wait_cb_ret(CALLBACK_TIMEOUT_5S); - if (OC_STACK_OK != ret) { - MA_LOGD( "OCUnlinkDevices Timeout = %d (%s)", ret, _error_to_string(ret)); - goto PVUNPAIR_ERROR; + } else { + ret = _wait_cb_ret(CALLBACK_TIMEOUT_5S); + if (OC_STACK_OK != ret) { + MA_LOGD( "OCUnlinkDevices Timeout = %d (%s)", ret, _error_to_string(ret)); + goto PVUNPAIR_ERROR; + } } /* display the pairwise-provisioned result */