Fixing outstanding issues (#1537)

* Correct stopEnableAttemptsTimer thread affinity

* Restart correctly, if running as service

* Add instance# in API response

* Qt6 updates

* Update fallthrough guide

* Update Compile warning
This commit is contained in:
LordGrey
2022-12-19 14:04:35 +01:00
committed by GitHub
parent 10b755b2ec
commit 2217135336
9 changed files with 26 additions and 17 deletions

View File

@@ -7,7 +7,7 @@
namespace Process {
void restartHyperion(bool asNewProcess)
void restartHyperion(int exitCode)
{
Logger* log = Logger::getInstance("Process");
Info(log, "Restarting hyperion ...");
@@ -18,7 +18,8 @@ void restartHyperion(bool asNewProcess)
QProcess::startDetached(QCoreApplication::applicationFilePath(), arguments);
QCoreApplication::quit();
//Exit with non-zero code to ensure service deamon restarts hyperion
QCoreApplication::exit(exitCode);
}
QByteArray command_exec(const QString& /*cmd*/, const QByteArray& /*data*/)
@@ -42,9 +43,15 @@ QByteArray command_exec(const QString& /*cmd*/, const QByteArray& /*data*/)
#include <memory>
#include <stdexcept>
#include <csignal>
#include <QDebug>
#include <QMetaObject>
namespace Process {
void restartHyperion(bool asNewProcess)
void restartHyperion(int exitCode)
{
Logger* log = Logger::getInstance("Process");
Info(log, "Restarting hyperion ...");
@@ -60,10 +67,11 @@ void restartHyperion(bool asNewProcess)
QProcess::startDetached(QCoreApplication::applicationFilePath(), arguments);
QCoreApplication::quit();
//Exit with non-zero code to ensure service deamon restarts hyperion
QCoreApplication::exit(exitCode);
}
QByteArray command_exec(const QString& cmd, const QByteArray& data)
QByteArray command_exec(const QString& cmd, const QByteArray& /*data*/)
{
char buffer[128];
QString result;
@@ -73,7 +81,7 @@ QByteArray command_exec(const QString& cmd, const QByteArray& data)
{
while (!feof(pipe.get()))
{
if (fgets(buffer, 128, pipe.get()) != NULL)
if (fgets(buffer, 128, pipe.get()) != nullptr)
result += buffer;
}
}