From 223c40931e4f413431ab2f84d92c5f404e2d9cf2 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 19 Oct 2018 15:56:09 -0700 Subject: sdevent: Remove in favor of sdeventplus This change removes the one off sd-event wrapper from the project and uses the openbmc wide sdeventplus library. Change-Id: I8e042f875d06082e15606c7191a8073974f93990 Signed-off-by: William A. Kennington III --- src/main.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0626081..29db39a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,23 +21,13 @@ #include #include +#include using namespace phosphor::dbus::monitoring; -struct Loop -{ - /** @brief indefinitely process dbus traffic. */ - static void run() - { - auto& bus = SDBusPlus::getBus(); - auto& event = SDEvent::getEvent(); - event.attach(bus); - event.loop(); - } -}; - int main(void) { + auto event = sdeventplus::Event::get_default(); auto& bus = SDBusPlus::getBus(); // Add sdbusplus Object Manager for the 'root' path of events. @@ -65,7 +55,6 @@ int main(void) watch->callback(Context::START); } - Loop::run(); - - return -1; + bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL); + return event.loop(); } -- cgit v1.2.1