From: Romain Forlot Date: Fri, 24 Feb 2017 08:50:26 +0000 (+0000) Subject: Fix: wrong if...else atomic expression X-Git-Tag: 3.99.1~448 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=f0e05e08bf3a62d34d4651b42665e9086559aa68;p=apps%2Flow-level-can-service.git Fix: wrong if...else atomic expression Change-Id: I995e6c6eb5e7e6d3f7ade17b8386706a5144f3bb Signed-off-by: Romain Forlot --- 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();