From f0e05e08bf3a62d34d4651b42665e9086559aa68 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 24 Feb 2017 08:50:26 +0000 Subject: Fix: wrong if...else atomic expression Change-Id: I995e6c6eb5e7e6d3f7ade17b8386706a5144f3bb Signed-off-by: Romain Forlot --- src/can-utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/can-utils.cpp b/src/can-utils.cpp index 8bf0567..8a91bd1 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(); -- cgit 1.2.3-korg