use sdbusplus unpack syntax
Rather than defining a variable and then reading it from a message,
sdbusplus also supports directly unpack-ing from the message. Use
this syntax instead as it is more efficient and succinct.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I63db2d97ffc394519d6eaa2ad6e67c0e44fbb741
diff --git a/bmc/general_systemd.cpp b/bmc/general_systemd.cpp
index ce16d14..1e9fdf0 100644
--- a/bmc/general_systemd.cpp
+++ b/bmc/general_systemd.cpp
@@ -57,8 +57,9 @@
method.append(triggerService);
method.append(mode);
- sdbusplus::message::object_path obj_path;
- bus.call(method).read(obj_path);
+ auto obj_path =
+ bus.call(method).unpack<sdbusplus::message::object_path>();
+
job = std::move(obj_path);
std::fprintf(stderr, "Triggered %s mode %s: %s\n",
triggerService.c_str(), mode.c_str(), job->c_str());