X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-api%2Fbt-event-handler.c;h=bef35df3cc0818863de79fc8912d3ff758cb8f35;hb=cd9e35acccf53453cf686a5b82e7ceac7707bea9;hp=09691d8fc3f0830823cf9292a427db4792d7d0e5;hpb=07e174e898ecdeef50d5a7daf7147823dd164c63;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-api/bt-event-handler.c b/bt-api/bt-event-handler.c index 09691d8..bef35df 100644 --- a/bt-api/bt-event-handler.c +++ b/bt-api/bt-event-handler.c @@ -4366,8 +4366,17 @@ int _bt_register_event(int event_type, void *event_cb, void *user_data) const char *path; const char *interface = BT_EVENT_SERVICE; - if (is_initialized == FALSE) - _bt_init_event_handler(); + if (is_initialized == FALSE) { + int ret; + + ret = _bt_init_event_handler(); + + if (ret != BLUETOOTH_ERROR_NONE && + ret != BLUETOOTH_ERROR_ALREADY_INITIALIZED) { + BT_ERR("Fail to init the event handler"); + return ret; + } + } if (__bt_event_is_registered(event_type) == TRUE) { BT_ERR("The event is already registed");