usb-dbg: Handled error for host selector position
Added error handling for host selector position
and enhancement.
Tested on Yosemitev2
Signed-off-by: Karthikeyan Pasupathi <pkarthikeyan1509@gmail.com>
Change-Id: Iac9414ccc282bd3e24b6434f0ae57dac586659a6
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 2ee1e98..50e88b5 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -48,7 +48,7 @@
using namespace phosphor::logging;
-size_t getSelectorPosition();
+void getSelectorPosition(size_t& position);
static void registerOEMFunctions() __attribute__((constructor));
sdbusplus::bus_t dbus(ipmid_get_sd_bus_connection()); // from ipmid/api.h
static constexpr size_t maxFRUStringLength = 0x3F;
@@ -359,7 +359,7 @@
bool platform = isMultiHostPlatform();
if (platform == true)
{
- pos = getSelectorPosition();
+ getSelectorPosition(pos);
}
sd_bus* bus = NULL;