summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2018-02-21 19:23:16 +0530
committerRatan Gupta <ratagupt@in.ibm.com>2018-02-23 20:04:41 +0530
commitef69ac02f480902f61869ea4d2c08f6aa786786b (patch)
tree8f2c3ca8ff0733ca0f09e7fd84bd0aec82e6993e
parenta45e086dc57f51efb882bf864e78fe678238deea (diff)
downloadphosphor-dbus-monitor-ef69ac02f480902f61869ea4d2c08f6aa786786b.zip
phosphor-dbus-monitor-ef69ac02f480902f61869ea4d2c08f6aa786786b.tar.gz
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 <ratagupt@in.ibm.com>
-rw-r--r--src/event.hpp10
1 files changed, 9 insertions, 1 deletions
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<pathIndex>(n.first);
- const auto& propertyMeta = std::get<metaIndex>(n.first);
+ const auto& propertyMeta = std::get<propertyIndex>(n.first);
const auto& value = std::get<valueIndex>(n.second);
if (!value.get().empty())
OpenPOWER on IntegriCloud