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");