summaryrefslogtreecommitdiffstats
path: root/sol
diff options
context:
space:
mode:
Diffstat (limited to 'sol')
-rw-r--r--sol/sol_manager.cpp12
-rw-r--r--sol/sol_manager.hpp8
2 files changed, 11 insertions, 9 deletions
diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp
index ce0e5a4..8afc932 100644
--- a/sol/sol_manager.cpp
+++ b/sol/sol_manager.cpp
@@ -12,6 +12,16 @@ namespace sol
using namespace phosphor::logging;
+CustomFD::~CustomFD()
+{
+ if(fd >= 0)
+ {
+ // Remove the host console descriptor from the sd_event_loop
+ std::get<eventloop::EventLoop&>(singletonPool).stopHostConsole();
+ close(fd);
+ }
+}
+
void Manager::initHostConsoleFd()
{
struct sockaddr_un addr;
@@ -127,8 +137,6 @@ void Manager::stopPayloadInstance(uint8_t payloadInstance)
if (payloadMap.empty())
{
- // Remove the host console decriptor from the sd_event_loop
- std::get<eventloop::EventLoop&>(singletonPool).stopHostConsole();
consoleFD.reset();
}
}
diff --git a/sol/sol_manager.hpp b/sol/sol_manager.hpp
index a7e4a1c..e756574 100644
--- a/sol/sol_manager.hpp
+++ b/sol/sol_manager.hpp
@@ -33,13 +33,7 @@ struct CustomFD
CustomFD(int fd) :
fd(fd) {}
- ~CustomFD()
- {
- if(fd >=0)
- {
- close(fd);
- }
- }
+ ~CustomFD();
int operator()() const
{
OpenPOWER on IntegriCloud