attach the sd bus to sd_event to receive signals
Registering for property change signals for FRU inventory
data so notification is required.
Change-Id: I2dfee62d32b5b0726faa4643ee1efe9718424a61
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/main.cpp b/main.cpp
index e26bcda..842f098 100644
--- a/main.cpp
+++ b/main.cpp
@@ -30,6 +30,7 @@
sol::Manager&> singletonPool(manager, table, loop, solManager);
sd_bus* bus = nullptr;
+
FILE* ipmidbus = nullptr;
unsigned short g_sel_reserve = 0xFFFF;
sd_bus_slot* ipmid_slot = nullptr;
diff --git a/sd_event_loop.cpp b/sd_event_loop.cpp
index ed3e547..d4dc456 100644
--- a/sd_event_loop.cpp
+++ b/sd_event_loop.cpp
@@ -175,6 +175,7 @@
int r = 0;
sigset_t ss;
sd_event_source* source = nullptr;
+ auto bus = ipmid_get_sd_bus_connection();
r = sd_event_default(&event);
if (r < 0)
@@ -182,6 +183,13 @@
goto finish;
}
+ // Attach the bus to sd_event to service user requests
+ r = sd_bus_attach_event(bus, event, SD_EVENT_PRIORITY_NORMAL);
+ if (r < 0)
+ {
+ goto finish;
+ }
+
if (sigemptyset(&ss) < 0 || sigaddset(&ss, SIGTERM) < 0 ||
sigaddset(&ss, SIGINT) < 0)
{