aboutsummaryrefslogtreecommitdiffstats
path: root/src/can
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-09 13:07:57 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:40 +0100
commitbf763cd4dab85294f66bc95b3a7dd1dd3f6029c2 (patch)
tree9a6c4055b899789f7df43162d559546e57565dec /src/can
parentac634d12925f6d10ad8c4893ff8522008351f61b (diff)
Fix: wrong tested variable for socket.
Change-Id: Ice2325441474f1a075140e13dfffa0261106dff7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can')
-rw-r--r--src/can/can-bus-dev.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/can/can-bus-dev.cpp b/src/can/can-bus-dev.cpp
index b8dadcf8..87d7bf5b 100644
--- a/src/can/can-bus-dev.cpp
+++ b/src/can/can-bus-dev.cpp
@@ -39,7 +39,7 @@ can_bus_dev_t::can_bus_dev_t(const std::string& dev_name)
}
/// @brief Open the can socket and returning it
-/// @return -1
+/// @return -1 if something wrong.
int can_bus_dev_t::open()
{
const int canfd_on = 1;
@@ -48,7 +48,8 @@ int can_bus_dev_t::open()
struct timeval timeout;
DEBUG(binder_interface, "CAN Handler socket : %d", can_socket_.socket());
- if (can_socket_) return 0;
+ if (can_socket_)
+ return 0;
can_socket_.open(PF_CAN, SOCK_RAW, CAN_RAW);
if (can_socket_)