summaryrefslogtreecommitdiffstats
path: root/readeeprom.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-21 09:07:11 -0700
committerPatrick Venture <venture@google.com>2018-10-29 09:08:53 -0700
commita8093a25525555c48ca092e5130f7ff7ffa38006 (patch)
tree19ea38787f9ba3014480491d8747f6aab91f55be /readeeprom.cpp
parentc7eecc19632571319e39ab8e9f7500f7a5d1b245 (diff)
downloadipmi-fru-parser-a8093a25525555c48ca092e5130f7ff7ffa38006.tar.gz
ipmi-fru-parser-a8093a25525555c48ca092e5130f7ff7ffa38006.zip
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 <venture@google.com>
Diffstat (limited to 'readeeprom.cpp')
-rw-r--r--readeeprom.cpp25
1 files changed, 5 insertions, 20 deletions
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<ArgumentParser>(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<level::ERR>("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);
}
OpenPOWER on IntegriCloud