Skip to content

Commit

Permalink
Fixed NSSM_EVENT_DUPLICATEHANDLE_FAILED message.
Browse files Browse the repository at this point in the history
We were supposed to add a parameter explaining which handle couldn't be
duplicated.
  • Loading branch information
Iain Patterson committed Jan 19, 2014
1 parent 914e07a commit 5ba652d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {

if (! service->stdout_thread) {
if (! DuplicateHandle(GetCurrentProcess(), stdout_handle, GetCurrentProcess(), &si->hStdOutput, 0, true, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, error_string(GetLastError()), 0);
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, _T("stdout"), error_string(GetLastError()), 0);
return 4;
}
service->rotate_stdout_online = NSSM_ROTATE_OFFLINE;
Expand All @@ -314,7 +314,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {
if (si) {
/* Two handles to the same file will create a race. */
if (! DuplicateHandle(GetCurrentProcess(), si->hStdOutput, GetCurrentProcess(), &si->hStdError, 0, true, DUPLICATE_SAME_ACCESS)) {
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, error_string(GetLastError()), 0);
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDOUT, _T("stderr"), error_string(GetLastError()), 0);
return 6;
}
}
Expand All @@ -336,7 +336,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {

if (! service->stderr_thread) {
if (! DuplicateHandle(GetCurrentProcess(), stderr_handle, GetCurrentProcess(), &si->hStdError, 0, true, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDERR, error_string(GetLastError()), 0);
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DUPLICATEHANDLE_FAILED, NSSM_REG_STDERR, _T("stderr"), error_string(GetLastError()), 0);
return 7;
}
service->rotate_stderr_online = NSSM_ROTATE_OFFLINE;
Expand Down

0 comments on commit 5ba652d

Please sign in to comment.