summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-13 23:11:41 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:15:55 +0100
commitc6e3d9484ac4321e586586005269521b92e99027 (patch)
treeb5d348b9f5fa18287457e2dd16895602cb9abf4f
parent3e624c015e7e90ecedb597c71d9b77d185d318a7 (diff)
Fix: return before initialization of diagnostic manager.
Change-Id: I8485dec1ec5bb5dbea7edf4d9ac3a7d800b567b2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--src/low-can-binding.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index 8ecf742..7a19c62 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -247,15 +247,13 @@ extern "C"
/// Initialize CAN socket
if(can_bus_manager.init_can_dev() == 0)
- {
can_bus_manager.start_threads();
- return 0;
- }
/// Initialize Diagnostic manager that will handle obd2 requests.
/// We pass by default the first CAN bus device to its Initialization.
/// TODO: be able to choose the CAN bus device that will be use as Diagnostic bus.
- configuration_t::instance().get_diagnostic_manager().initialize(can_bus_manager.get_can_devices().front());
+ if(configuration_t::instance().get_diagnostic_manager().initialize(can_bus_manager.get_can_devices().front()))
+ return 0;
ERROR(binder_interface, "There was something wrong with CAN device Initialization. Check your config file maybe");
return 1;