summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.cpp1
-rw-r--r--sd_event_loop.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index e26bcda..842f098 100644
--- a/main.cpp
+++ b/main.cpp
@@ -30,6 +30,7 @@ std::tuple<session::Manager&, command::Table&, eventloop::EventLoop&,
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 EventLoop::startEventLoop()
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 @@ int EventLoop::startEventLoop()
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)
{
OpenPOWER on IntegriCloud