]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
No names for the service specific errors, probably wont ever name them as theyre...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 24 Aug 2008 21:05:15 +0000 (21:05 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 24 Aug 2008 21:05:15 +0000 (21:05 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10245 e03df62e-2008-0410-955e-edbf42e46eb7

include/exitcodes.h
src/inspircd.cpp
win/win32service.cpp

index d9658bd5b781d4964afb8f48f1bfafb4f6a3f0b5..bb1fa47e8fbed9d90876dc2ec564c3429b4027db 100644 (file)
@@ -34,7 +34,13 @@ enum ExitStatus
        EXIT_STATUS_MODULE = 13,        /* Couldn't load a required module */
        EXIT_STATUS_CREATEPROCESS = 14, /* CreateProcess failed (windows) */
        EXIT_STATUS_SIGTERM = 15,       /* Note: dont move this value. It corresponds with the value of #define SIGTERM. */
-       EXIT_STATUS_BADHANDLER = 16     /* Bad command handler loaded */
+       EXIT_STATUS_BADHANDLER = 16,    /* Bad command handler loaded */
+       EXIT_STATUS_WINSERVICE_1 = 17,  /* Windows service specific failure, will name these later */
+       EXIT_STATUS_WINSERVICE_2 = 18,  /* Windows service specific failure, will name these later */
+       EXIT_STATUS_WINSERVICE_3 = 19,  /* Windows service specific failure, will name these later */
+       EXIT_STATUS_WINSERVICE_4 = 20,  /* Windows service specific failure, will name these later */
+       EXIT_STATUS_WINSERVICE_5 = 21,  /* Windows service specific failure, will name these later */
+       EXIT_STATUS_WINSERVICE_6 = 22,  /* Windows service specific failure, will name these later */
 };
 
 /** Array that maps exit codes (ExitStatus types) to
index dab49ddf0cc84a703ab209e5fcf3600da153a4b8..550baa027d2c4e34500e16d51af887a2656c383b 100644 (file)
@@ -77,6 +77,13 @@ const char* ExitCodes[] =
                "Couldn't load module on startup", /* 13 */
                "Could not create windows forked process", /* 14 */
                "Received SIGTERM", /* 15 */
+               "Bad command handler loaded", /* 16 */
+               "Windows service specific error 1", /* 17 - Dont know what to call these yet, will give them */
+               "Windows service specific error 2", /* 18 - better descriptions later on */
+               "Windows service specific error 3", /* 19 */
+               "Windows service specific error 4", /* 20 */
+               "Windows service specific error 5", /* 21 */
+               "Windows service specific error 6"  /* 22 */
 };
 
 void InspIRCd::Cleanup()
index 42eaa998b4b16061be4b5dc262f3f689f41af852..ab1fae140a8a5a13a6a31b003dd5dc6cd1da9565 100644 (file)
@@ -84,7 +84,7 @@ void SetServiceRunning()
        BOOL success = UpdateSCMStatus(SERVICE_RUNNING, NO_ERROR, 0, 0, 0);
        if (!success)
        {
-               terminateService(6, GetLastError());
+               terminateService(22, GetLastError());
                return;
        }
 }
@@ -184,14 +184,14 @@ VOID ServiceMain(DWORD argc, LPTSTR *argv)
        serviceStatusHandle = RegisterServiceCtrlHandler("InspIRCd", (LPHANDLER_FUNCTION)ServiceCtrlHandler);
        if (!serviceStatusHandle)
        {
-               terminateService(1, GetLastError());
+               terminateService(18, GetLastError());
                return;
        }
 
        success = UpdateSCMStatus(SERVICE_START_PENDING, NO_ERROR, 0, 1, 1000);
        if (!success)
        {
-               terminateService(2, GetLastError());
+               terminateService(19, GetLastError());
                return;
        }
 
@@ -200,14 +200,14 @@ VOID ServiceMain(DWORD argc, LPTSTR *argv)
 
        if (!killServiceEvent || !hThreadEvent)
        {
-               terminateService(99, GetLastError());
+               terminateService(20, GetLastError());
                return;
        }
 
        success = UpdateSCMStatus(SERVICE_START_PENDING, NO_ERROR, 0, 2, 1000);
        if (!success)
        {
-               terminateService(2, GetLastError());
+               terminateService(21, GetLastError());
                return;
        }