mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user