From a8093a25525555c48ca092e5130f7ff7ffa38006 Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Sun, 21 Oct 2018 09:07:11 -0700 Subject: update: use sdbusplus instead of sd_bus raw pointers Update code to use sdbusplus instead of raw sd_bus pointers. Change-Id: I80cd4492480824827c27fbf19eb54487e28d3b75 Signed-off-by: Patrick Venture --- readeeprom.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'readeeprom.cpp') diff --git a/readeeprom.cpp b/readeeprom.cpp index a9dd91d..d518a83 100644 --- a/readeeprom.cpp +++ b/readeeprom.cpp @@ -25,9 +25,6 @@ int main(int argc, char** argv) int rc = 0; uint8_t fruid = 0; - // Handle to per process system bus - sd_bus* bus_type = NULL; - // Read the arguments. auto cli_options = std::make_unique(argc, argv); @@ -57,23 +54,11 @@ int main(int argc, char** argv) // Finished getting options out, so release the parser. cli_options.release(); - // Get a handle to System Bus - rc = sd_bus_open_system(&bus_type); - if (rc < 0) - { - log("Failed to connect to system bus", - entry("ERRNO=%s", std::strerror(-rc))); - } - else - { - // Now that we have the file that contains the eeprom data, go read it - // and update the Inventory DB. - bool bmc_fru = true; - rc = validateFRUArea(fruid, eeprom_file.c_str(), bus_type, bmc_fru); - } - - // Cleanup - sd_bus_unref(bus_type); + // Now that we have the file that contains the eeprom data, go read it + // and update the Inventory DB. + auto bus = sdbusplus::bus::new_default(); + bool bmc_fru = true; + rc = validateFRUArea(fruid, eeprom_file.c_str(), bus, bmc_fru); return (rc < 0 ? EXIT_FAILURE : EXIT_SUCCESS); } -- cgit v1.2.1