From 52dbfc38b730b3e115ae326ea9ca6d952c67a8bb Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 11 Nov 2019 09:43:12 +0100 Subject: [PATCH] Fix service on Windows not working in UnrealIRCd 5 now that we have the bin\ directory. --- src/windows/service.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/windows/service.c b/src/windows/service.c index 5ae6397ae..dc76411d8 100644 --- a/src/windows/service.c +++ b/src/windows/service.c @@ -97,11 +97,6 @@ VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) IsService = TRUE; - /* Go one level up, since we are currently in the bin\ subdir - * and we want to be in (f.e.) "C:\Program Files\UnrealIRCd 5" - */ - chdir(".."); - /* Initialize the service structure */ IRCDStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; IRCDStatus.dwCurrentState = SERVICE_START_PENDING; @@ -116,6 +111,11 @@ VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) *folder = 0; chdir(path); + /* Go one level up, since we are currently in the bin\ subdir + * and we want to be in (f.e.) "C:\Program Files\UnrealIRCd 5" + */ + chdir(".."); + /* Register the service controller */ IRCDStatusHandle = RegisterServiceCtrlHandler("UnrealIRCd", IRCDCtrlHandler);