/// against the application framework using that event handle.
static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe, std::shared_ptr<low_can_subscription_t>& can_subscription, std::map<int, std::shared_ptr<low_can_subscription_t> >& s)
{
- int ret;
+ int ret = -1;
int sub_index = can_subscription->get_index();
if (can_subscription && s.find(sub_index) != s.end())
NOTICE(binder_interface, "%s: Event isn't valid, no need to unsubscribed.", __FUNCTION__);
ret = -1;
}
+ ret = 0;
}
else
{
can_subscription = std::make_shared<low_can_subscription_t>(low_can_subscription_t(event_filter));
if(can_subscription->create_rx_filter(sig) < 0)
{return -1;}
+ if(add_to_event_loop(can_subscription) < 0)
+ {return -1;}
}
if(subscribe_unsubscribe_signal(request, subscribe, can_subscription, s) < 0)
{return -1;}
- if(add_to_event_loop(can_subscription) < 0)
- {return -1;}
rets++;
DEBUG(binder_interface, "%s: signal: %s subscribed", __FUNCTION__, sig->get_name().c_str());
}