Fixed NSSM_EVENT_DUPLICATEHANDLE_FAILED message.
authorIain Patterson <me@iain.cx>
Sun, 19 Jan 2014 17:12:52 +0000 (17:12 +0000)
committerIain Patterson <me@iain.cx>
Sun, 19 Jan 2014 17:12:52 +0000 (17:12 +0000)
We were supposed to add a parameter explaining which handle couldn't be
duplicated.

io.cpp

diff --git a/io.cpp b/io.cpp
index 3f80810..d18e31c 100644 (file)
--- a/io.cpp
+++ b/io.cpp
@@ -288,7 +288,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {
 \r
     if (! service->stdout_thread) {\r
       if (! DuplicateHandle(GetCurrentProcess(), stdout_handle, GetCurrentProcess(), &si->hStdOutput, 0, true, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {\r
-        log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, error_string(GetLastError()), 0);\r
+        log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, _T("stdout"), error_string(GetLastError()), 0);\r
         return 4;\r
       }\r
       service->rotate_stdout_online = NSSM_ROTATE_OFFLINE;\r
@@ -314,7 +314,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {
       if (si) {\r
         /* Two handles to the same file will create a race. */\r
         if (! DuplicateHandle(GetCurrentProcess(), si->hStdOutput, GetCurrentProcess(), &si->hStdError, 0, true, DUPLICATE_SAME_ACCESS)) {\r
-          log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, error_string(GetLastError()), 0);\r
+          log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, _T("stderr"), error_string(GetLastError()), 0);\r
           return 6;\r
         }\r
       }\r
@@ -336,7 +336,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {
 \r
       if (! service->stderr_thread) {\r
         if (! DuplicateHandle(GetCurrentProcess(), stderr_handle, GetCurrentProcess(), &si->hStdError, 0, true, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {\r
-          log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDERR, error_string(GetLastError()), 0);\r
+          log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDERR, _T("stderr"), error_string(GetLastError()), 0);\r
           return 7;\r
         }\r
         service->rotate_stderr_online = NSSM_ROTATE_OFFLINE;\r