From 21eb043e7936364aa92ca1bfe8bddbd2754b77f5 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Fri, 31 Mar 2017 11:40:48 -0500 Subject: writefrudata: Reuse ipmi bus for inventory-notify Partially fixes openbmc/openbmc#875. Change-Id: Ieaaa65fa8432ffa873dcf2f4f96f9c1e09de3008 Signed-off-by: Patrick Williams --- writefrudata.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/writefrudata.cpp b/writefrudata.cpp index 8b59e9a..5c46f5f 100644 --- a/writefrudata.cpp +++ b/writefrudata.cpp @@ -445,7 +445,7 @@ auto getService(sdbusplus::bus::bus& bus, // Takes FRU data, invokes Parser for each fru record area and updates // Inventory //------------------------------------------------------------------------ -int ipmi_update_inventory(fru_area_vec_t& area_vec) +int ipmi_update_inventory(fru_area_vec_t& area_vec, sd_bus* bus_sd) { // Generic error reporter int rc = 0; @@ -474,7 +474,7 @@ int ipmi_update_inventory(fru_area_vec_t& area_vec) // Here we are just printing the object,interface and the properties. // which needs to be called with the new inventory manager implementation. - auto bus = sdbusplus::bus::new_default(); + sdbusplus::bus::bus bus{sd_bus_ref(bus_sd)}; using namespace std::string_literals; static const auto intf = "xyz.openbmc_project.Inventory.Manager"s; static const auto path = "/xyz/openbmc_project/inventory"s; @@ -938,7 +938,7 @@ int ipmi_validate_fru_area(const uint8_t fruid, const char *fru_file_name, #ifdef __IPMI_DEBUG__ printf("\n SIZE of vector is : [%d] \n",fru_area_vec.size()); #endif - rc = ipmi_update_inventory(fru_area_vec); + rc = ipmi_update_inventory(fru_area_vec, bus_type); if(rc <0) { fprintf(stderr, "Error updating inventory\n"); -- cgit v1.2.1