diff options
author | William A. Kennington III <wak@google.com> | 2018-10-19 15:56:09 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-06 14:00:26 +0000 |
commit | 223c40931e4f413431ab2f84d92c5f404e2d9cf2 (patch) | |
tree | fae46d08b8e00a2f0d34b62638ab090cd3831c3d /src/main.cpp | |
parent | ecf8910c014b94c688d08fa856cd22ec365583fa (diff) | |
download | phosphor-dbus-monitor-223c40931e4f413431ab2f84d92c5f404e2d9cf2.tar.gz phosphor-dbus-monitor-223c40931e4f413431ab2f84d92c5f404e2d9cf2.zip |
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 <wak@google.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
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 <sdbusplus/bus.hpp> #include <sdbusplus/server/manager.hpp> +#include <sdeventplus/event.hpp> 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(); } |