From ac8094099ad044ac0b21b9c531cf0b9c1d8bf5d7 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Tue, 16 Nov 2021 17:13:39 +0100 Subject: Hooked up zenserver:main() to ZenEntryPoint::Run() on POSIX --- zenserver/zenserver.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'zenserver/zenserver.cpp') diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index ad4d1ba84..f0648698c 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -917,7 +917,7 @@ public: virtual int Run() override; private: - ZenEntryPoint m_EntryPoint; + zen::ZenEntryPoint m_EntryPoint; }; int @@ -967,7 +967,6 @@ main(int argc, char* argv[]) try { -#if ZEN_PLATFORM_WINDOWS ZenServerOptions GlobalOptions; ZenServiceConfig ServiceConfig; ParseGlobalCliOptions(argc, argv, GlobalOptions, ServiceConfig); @@ -978,6 +977,7 @@ main(int argc, char* argv[]) std::filesystem::create_directories(GlobalOptions.DataDir); } +#if ZEN_PLATFORM_WINDOWS if (GlobalOptions.InstallService) { WindowsService::Install(); @@ -995,8 +995,14 @@ main(int argc, char* argv[]) ZenWindowsService App(GlobalOptions, ServiceConfig); return App.ServiceMain(); #else - return 1; -#endif + if (GlobalOptions.InstallService || GlobalOptions.UninstallService) + { + throw std::runtime_error("Service mode is not supported on this platform"); + } + + ZenEntryPoint App(GlobalOptions, ServiceConfig); + return App.Run(); +#endif // ZEN_PLATFORM_WINDOWS } catch (std::exception& Ex) { -- cgit v1.2.3