event: Remove in favor of sdeventplus
Use the new library provided to all openbmc projects instead of rolling
our own managed pointer.
Tested: Compiled
Change-Id: I4993d4340e0e0aa5898e73ef815baa81b0e8a2bc
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/power-sequencer/pgood_monitor.cpp b/power-sequencer/pgood_monitor.cpp
index 02f1725..b9995c6 100644
--- a/power-sequencer/pgood_monitor.cpp
+++ b/power-sequencer/pgood_monitor.cpp
@@ -66,16 +66,6 @@
}
-void PGOODMonitor::exitEventLoop()
-{
- auto r = sd_event_exit(event.get(), EXIT_SUCCESS);
- if (r < 0)
- {
- log<level::ERR>("sd_event_exit failed",
- entry("RC = %d", r));
- }
-}
-
void PGOODMonitor::analyze()
{
//Timer callback.
@@ -93,8 +83,7 @@
//The pgood-wait service (with a longer timeout)
//will handle powering off the system.
-
- exitEventLoop();
+ event.exit(EXIT_SUCCESS);
}
void PGOODMonitor::propertyChanged()
@@ -104,8 +93,7 @@
if (!pgoodPending())
{
//PGOOD is on, or system is off, so we are done.
- timer.stop();
- exitEventLoop();
+ event.exit(EXIT_SUCCESS);
}
}
@@ -134,13 +122,7 @@
}
timer.start(interval);
-
- auto r = sd_event_loop(event.get());
- if (r < 0)
- {
- log<level::ERR>("sd_event_loop() failed",
- entry("ERROR=%d", r));
- }
+ return event.loop();
}
catch (std::exception& e)
{