diff options
| author | William A. Kennington III <wak@google.com> | 2018-09-11 00:36:30 -0700 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-09-18 13:03:09 +0000 |
| commit | 5b701c66a808d5b80436c71cc9ce8576ad3dfda6 (patch) | |
| tree | 819c8e7429e5c60ff79d45b54d5d35429e23d585 | |
| parent | 035c73b2136fdd88c1db7a0ec89f08e312092130 (diff) | |
| download | sdbusplus-5b701c66a808d5b80436c71cc9ce8576ad3dfda6.tar.gz sdbusplus-5b701c66a808d5b80436c71cc9ce8576ad3dfda6.zip | |
bus: Add sd_bus_call() helper that ignores errors
This helper wraps the noreply case to make it trivial for callers to
ignore all errors associated with a call.
Change-Id: I9ddd639633694b315384f71e49f0760ada6de6ce
Signed-off-by: William A. Kennington III <wak@google.com>
| -rw-r--r-- | sdbusplus/bus.hpp.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sdbusplus/bus.hpp.in b/sdbusplus/bus.hpp.in index 9252b73..9e7476b 100644 --- a/sdbusplus/bus.hpp.in +++ b/sdbusplus/bus.hpp.in @@ -270,6 +270,24 @@ struct bus } } + /** @brief Perform a message call, ignoring the reply and any errors + * in the dbus stack. + * + * @param[in] m - The method_call message. + * @param[in] timeout_us - The timeout for the method call. + */ + void call_noreply_noerror(message::message& m, uint64_t timeout_us = 0) + { + try + { + call_noreply(m, timeout_us); + } + catch (exception::SdBusError&) + { + // Intentionally ignoring these sd_bus errors + } + } + /** @brief Get the bus unique name. Ex: ":1.11". * * @return The bus unique name. |

