Fix build issues with boost 1.87
With boost 1.87, some calls to spawn() generate this error:
error: ignoring returned value of type 'boost::asio::
deferred_async_operation<void(std::__exception_ptr::exception_ptr),
boost::asio::detail::initiate_spawn<boost::asio::io_context::
basic_executor_type<std::allocator<void>, 0> >...', declared with
attribute 'nodiscard' [-Werror=unused-result]
Change-Id: I2e98bc9f45c729ab2b0efe7b51d3eeb87aa37e6b
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/src/storagecommands.cpp b/src/storagecommands.cpp
index ad63d77..8ca7fd5 100644
--- a/src/storagecommands.cpp
+++ b/src/storagecommands.cpp
@@ -360,11 +360,12 @@
});
// call once to populate
- boost::asio::spawn(*getIoContext(),
- [](boost::asio::yield_context yield) {
- replaceCacheFru(getSdBus(), yield);
- },
- {});
+ boost::asio::spawn(
+ *getIoContext(),
+ [](boost::asio::yield_context yield) {
+ replaceCacheFru(getSdBus(), yield);
+ },
+ boost::asio::detached);
}
/** @brief implements the read FRU data command