Skip to content

Commit

Permalink
offline: Fix constructing vector from D-Bus value
Browse files Browse the repository at this point in the history
Use explicit std::vector<std::string> constructor instead of uniform
initialization.
  • Loading branch information
m-blaha committed Feb 19, 2025
1 parent 7f3a61c commit 36d5e1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dnf5/commands/offline/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ void OfflineRebootCommand::run() {
.storeResultsTo(unit_object_path);

auto unit_proxy = sdbus::createProxy(SYSTEMD_DESTINATION_NAME, unit_object_path);
const auto & wants =
std::vector<std::string>{unit_proxy->getProperty("Wants").onInterface(SYSTEMD_UNIT_INTERFACE)};
const auto wants =
std::vector<std::string>(unit_proxy->getProperty("Wants").onInterface(SYSTEMD_UNIT_INTERFACE));
if (std::find(wants.begin(), wants.end(), SYSTEMD_SERVICE_NAME) == wants.end()) {
throw libdnf5::cli::CommandExitError(
1, M_("{} is not wanted by system-update.target."), SYSTEMD_SERVICE_NAME);
Expand Down

0 comments on commit 36d5e1d

Please sign in to comment.