From ef69ac02f480902f61869ea4d2c08f6aa786786b Mon Sep 17 00:00:00 2001 From: Ratan Gupta Date: Wed, 21 Feb 2018 19:23:16 +0530 Subject: Don't take action if the callback is of event type When event call back is called,There could be two context 1) As part of actual D-bus signal 2) During startup of dbus-monitor if event call back is called with context as startup then don't take any action. Corrected the index value to fetch the property name. Change-Id: Ifaae33dc78841c8f771fe3788e75f79d9de6ec12 Signed-off-by: Ratan Gupta --- src/event.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/event.hpp') diff --git a/src/event.hpp b/src/event.hpp index 22834bf..ca256a7 100644 --- a/src/event.hpp +++ b/src/event.hpp @@ -32,10 +32,18 @@ class EventBase : public IndexedCallback /** @brief Callback interface implementation. */ void operator()(Context ctx) override { + if (ctx == Context::START) + { + // No action should be taken + // as this call back is being called from + // daemon Startup. + return; + } + for (const auto& n : index) { const auto& path = std::get(n.first); - const auto& propertyMeta = std::get(n.first); + const auto& propertyMeta = std::get(n.first); const auto& value = std::get(n.second); if (!value.get().empty()) -- cgit v1.2.1