From 1cfc2f11b13412a15f8478cebc35e50e6feb13a2 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 19 Oct 2018 17:29:46 -0700 Subject: Switch sd_event loops to sdeventplus This change is mostly focused around plumbing the sdeventplus::Event object everywhere and using the member functions provided for the event. No migration to the timer utility is performed yet. Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87 Signed-off-by: William A. Kennington III --- presence/tach_detect.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'presence/tach_detect.cpp') diff --git a/presence/tach_detect.cpp b/presence/tach_detect.cpp index da0f40f..9b23571 100644 --- a/presence/tach_detect.cpp +++ b/presence/tach_detect.cpp @@ -15,24 +15,20 @@ */ #include "generated.hpp" #include "sdbusplus.hpp" -#include "sdevent.hpp" - +#include int main(void) { using namespace phosphor::fan; - auto& event = util::SDEvent::getEvent(); - event.attach(util::SDBusPlus::getBus()); + auto event = sdeventplus::Event::get_default(); + util::SDBusPlus::getBus().attach_event( + event.get(), SD_EVENT_PRIORITY_NORMAL); for (auto& p: presence::ConfigPolicy::get()) { p->monitor(); } - event.loop(); - - // The loop should never exit. Exit with - // non zero status just in case. - return 1; + return event.loop(); } -- cgit v1.2.1