aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-24 08:50:26 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-24 08:50:26 +0000
commitf0e05e08bf3a62d34d4651b42665e9086559aa68 (patch)
treec2a4911de93634b21deb690a2bc10e7be22fff43 /src
parentb33043dafb15c76a02e4532d3a161bef4e191625 (diff)
Fix: wrong if...else atomic expression
Change-Id: I995e6c6eb5e7e6d3f7ade17b8386706a5144f3bb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/can-utils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/can-utils.cpp b/src/can-utils.cpp
index 8bf05670..8a91bd15 100644
--- a/src/can-utils.cpp
+++ b/src/can-utils.cpp
@@ -191,7 +191,10 @@ int can_bus_t::init_can_dev()
for(const auto& device : devices_name)
{
can_bus_dev_t can_bus_device_handler(device);
- (can_bus_device_handler.open()) ? i++ : ERROR(binder_interface, "Can't open device %s", device);
+ if (can_bus_device_handler.open())
+ i++;
+ else
+ ERROR(binder_interface, "Can't open device %s", device);
can_bus_device_handler.start_reading(std::ref(*this));
}
can_frame_mutex.unlock();