The socket opening wasn't tested and we fails later on another function
using the wrongly opened socket. This would not happens anymore.
Bug-AGL: SPEC-2988
Change-Id: I9b30bd9fc13b99277cbef6f7aeaddadc57ad0b18
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
{
socket_ = socketcan_t::open(PF_CAN, SOCK_DGRAM, CAN_J1939);
+ if (socket_ < 0)
+ return socket_;
define_tx_address(device_name, name, pgn, addr);
{
close();
socket_ = ::socket(domain, type, protocol);
+ if (socket_ < 0)
+ AFB_ERROR("Open failed. %s", strerror(errno));
+
return socket_;
}