From 31fd65ea15af79a83f0beda007913aa219f2da74 Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Fri, 7 Dec 2018 01:27:00 +0100 Subject: [PATCH] Fix pre shutdown select (#397) --- syncd/syncd.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/syncd/syncd.cpp b/syncd/syncd.cpp index 4560785c4ce9..b91e43716a37 100644 --- a/syncd/syncd.cpp +++ b/syncd/syncd.cpp @@ -3633,13 +3633,13 @@ int syncd_main(int argc, char **argv) SWSS_LOG_NOTICE("syncd listening for events"); - swss::Select s; + std::shared_ptr s = std::make_shared(); - s.addSelectable(asicState.get()); - s.addSelectable(restartQuery.get()); - s.addSelectable(flexCounter.get()); - s.addSelectable(flexCounterGroup.get()); - s.addSelectable(ffb.get()); + s->addSelectable(asicState.get()); + s->addSelectable(restartQuery.get()); + s->addSelectable(flexCounter.get()); + s->addSelectable(flexCounterGroup.get()); + s->addSelectable(ffb.get()); SWSS_LOG_NOTICE("starting main loop"); @@ -3647,7 +3647,7 @@ int syncd_main(int argc, char **argv) { swss::Selectable *sel = NULL; - int result = s.select(&sel); + int result = s->select(&sel); if (sel == restartQuery.get()) { @@ -3710,9 +3710,9 @@ int syncd_main(int argc, char **argv) { warmRestartTable->hset("warm-shutdown", "state", "pre-shutdown-succeeded"); - s = swss::Select(); + s = std::make_shared(); // make sure previous select is destroyed - s.addSelectable(restartQuery.get()); + s->addSelectable(restartQuery.get()); SWSS_LOG_NOTICE("switched to PRE_SHUTDOWN, from now on accepting only shurdown requests"); }