refactor: App make m_bye private access it from the method bye

This commit is contained in:
sithlord48 2025-08-04 10:31:16 -04:00 committed by Nick Bolton
parent 3b2b8a9ebe
commit 1968669a39
3 changed files with 11 additions and 11 deletions

View file

@ -113,9 +113,9 @@ public:
protected:
void runEventsLoop(void *);
void (*m_bye)(int);
private:
void (*m_bye)(int);
IEventQueue *m_events = nullptr;
deskflow::ArgsBase *m_args;
static App *s_instance;

View file

@ -72,9 +72,9 @@ void ClientApp::parseArgs(int argc, const char *const *argv)
if (!result || args().m_shouldExitOk || args().m_shouldExitFail) {
if (args().m_shouldExitOk) {
m_bye(s_exitSuccess);
bye(s_exitSuccess);
} else {
m_bye(s_exitArgs);
bye(s_exitArgs);
}
} else {
// save server address
@ -89,7 +89,7 @@ void ClientApp::parseArgs(int argc, const char *const *argv)
// Priddy.
if (!args().m_restartable || e.getError() == XSocketAddress::SocketError::BadPort) {
LOG((CLOG_CRIT "%s: %s" BYE, args().m_pname, e.what(), args().m_pname));
m_bye(s_exitFailed);
bye(s_exitFailed);
}
}
}
@ -442,7 +442,7 @@ void ClientApp::startNode()
// we shouldn't retry.
LOG((CLOG_DEBUG1 "starting client"));
if (!startClient()) {
m_bye(s_exitFailed);
bye(s_exitFailed);
}
}

View file

@ -80,9 +80,9 @@ void ServerApp::parseArgs(int argc, const char *const *argv)
if (!result || args().m_shouldExitOk || args().m_shouldExitFail) {
if (args().m_shouldExitOk) {
m_bye(s_exitSuccess);
bye(s_exitSuccess);
} else {
m_bye(s_exitArgs);
bye(s_exitArgs);
}
} else {
if (!args().m_deskflowAddress.empty()) {
@ -91,7 +91,7 @@ void ServerApp::parseArgs(int argc, const char *const *argv)
m_deskflowAddress->resolve();
} catch (XSocketAddress &e) {
LOG((CLOG_CRIT "%s: %s" BYE, args().m_pname, e.what(), args().m_pname));
m_bye(s_exitArgs);
bye(s_exitArgs);
}
}
}
@ -162,12 +162,12 @@ void ServerApp::loadConfig()
const auto path = args().m_configFile;
if (path.empty()) {
LOG((CLOG_CRIT "no configuration path provided"));
m_bye(s_exitConfig);
bye(s_exitConfig);
}
if (!loadConfig(path)) {
LOG((CLOG_CRIT "%s: failed to load config: %s", args().m_pname, path.c_str()));
m_bye(s_exitConfig);
bye(s_exitConfig);
}
}
@ -721,6 +721,6 @@ void ServerApp::startNode()
// we shouldn't retry.
LOG((CLOG_DEBUG1 "starting server"));
if (!startServer()) {
m_bye(s_exitFailed);
bye(s_exitFailed);
}
}