chore: remove unused name parameter from ARCH->daemonize
This commit is contained in:
@ -12,12 +12,10 @@
|
||||
// ArchDaemonNone
|
||||
//
|
||||
|
||||
int ArchDaemonNone::daemonize(const QString &name, DaemonFunc const &func)
|
||||
int ArchDaemonNone::daemonize(DaemonFunc const &func)
|
||||
{
|
||||
// simply forward the call to func. obviously, this doesn't
|
||||
// do any daemonizing.
|
||||
auto t = name.toStdString();
|
||||
const char *n = t.c_str();
|
||||
return func();
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,6 @@ public:
|
||||
~ArchDaemonNone() override = default;
|
||||
|
||||
// IArchDaemon overrides
|
||||
int daemonize(const QString &name, DaemonFunc const &func) override;
|
||||
int daemonize(DaemonFunc const &func) override;
|
||||
QString commandLine() const override;
|
||||
};
|
||||
|
||||
@ -53,7 +53,7 @@ public:
|
||||
\c ArchMiscWindows::daemonFailed() to indicate startup failure.
|
||||
</ul>
|
||||
*/
|
||||
virtual int daemonize(const QString &name, DaemonFunc const &func) = 0;
|
||||
virtual int daemonize(DaemonFunc const &func) = 0;
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
@ -47,12 +47,10 @@ bool alreadyDaemonized()
|
||||
|
||||
#endif
|
||||
|
||||
int ArchDaemonUnix::daemonize(const QString &name, DaemonFunc const &func)
|
||||
int ArchDaemonUnix::daemonize(DaemonFunc const &func)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (alreadyDaemonized()) {
|
||||
auto t = name.toStdString();
|
||||
const char *n = t.c_str();
|
||||
return func();
|
||||
}
|
||||
#endif
|
||||
@ -108,8 +106,5 @@ int ArchDaemonUnix::daemonize(const QString &name, DaemonFunc const &func)
|
||||
#endif
|
||||
|
||||
// invoke function
|
||||
|
||||
auto t = name.toStdString();
|
||||
const char *n = t.c_str();
|
||||
return func();
|
||||
}
|
||||
|
||||
@ -20,5 +20,5 @@ public:
|
||||
~ArchDaemonUnix() override = default;
|
||||
|
||||
// IArchDaemon overrides
|
||||
int daemonize(const QString &name, DaemonFunc const &func) override;
|
||||
int daemonize(DaemonFunc const &func) override;
|
||||
};
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#include "arch/win32/ArchMiscWindows.h"
|
||||
#include "arch/win32/XArchWindows.h"
|
||||
#include "base/Log.h"
|
||||
#include "common/Constants.h"
|
||||
|
||||
//
|
||||
// ArchDaemonWindows
|
||||
@ -52,7 +53,7 @@ void ArchDaemonWindows::daemonFailed(int result)
|
||||
throw ArchDaemonRunException(result);
|
||||
}
|
||||
|
||||
int ArchDaemonWindows::daemonize(const QString &name, DaemonFunc const &func)
|
||||
int ArchDaemonWindows::daemonize(DaemonFunc const &func)
|
||||
{
|
||||
assert(name != nullptr);
|
||||
assert(func != nullptr);
|
||||
@ -62,7 +63,7 @@ int ArchDaemonWindows::daemonize(const QString &name, DaemonFunc const &func)
|
||||
|
||||
// construct the service entry
|
||||
SERVICE_TABLE_ENTRY entry[2];
|
||||
entry[0].lpServiceName = const_cast<wchar_t *>(name.toStdWString().c_str());
|
||||
entry[0].lpServiceName = const_cast<wchar_t *>(QString(kAppName).toStdWString().c_str());
|
||||
entry[0].lpServiceProc = &ArchDaemonWindows::serviceMainEntry;
|
||||
entry[1].lpServiceName = nullptr;
|
||||
entry[1].lpServiceProc = nullptr;
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
static UINT getDaemonQuitMessage();
|
||||
|
||||
// IArchDaemon overrides
|
||||
int daemonize(const QString &name, DaemonFunc const &func) override;
|
||||
int daemonize(DaemonFunc const &func) override;
|
||||
QString commandLine() const override
|
||||
{
|
||||
return m_commandLine;
|
||||
|
||||
@ -138,7 +138,7 @@ void DaemonApp::run(QThread &daemonThread)
|
||||
mainLoop();
|
||||
} else {
|
||||
LOG_DEBUG("running daemon in background (daemonizing)");
|
||||
ARCH->daemonize(kAppName, [this] { return daemonLoop(); });
|
||||
ARCH->daemonize([this] { return daemonLoop(); });
|
||||
}
|
||||
|
||||
daemonThread.quit();
|
||||
|
||||
@ -89,7 +89,7 @@ int AppUtilWindows::daemonNTStartup()
|
||||
{
|
||||
SystemLogger sysLogger(app().daemonName(), false);
|
||||
m_exitMode = kExitModeDaemon;
|
||||
return ARCH->daemonize(app().daemonName(), daemonNTMainLoopStatic);
|
||||
return ARCH->daemonize(daemonNTMainLoopStatic);
|
||||
}
|
||||
|
||||
static int daemonNTStartupStatic()
|
||||
|
||||
Reference in New Issue
Block a user