From d69db812fe68fb913f65e6aa8ac8584ee079c0c6 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Sun, 12 Jan 2014 23:02:23 +0000 Subject: [PATCH] Fixed copy/paste bug with I/O. The stderr file was incorrectly being created with stdout paramters. --- io.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io.cpp b/io.cpp index 0fbc4e4..2602dc2 100644 --- a/io.cpp +++ b/io.cpp @@ -290,7 +290,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) { } /* stderr */ - if (get_createfile_parameters(key, NSSM_REG_STDERR, service->stderr_path, &service->stdout_sharing, NSSM_STDERR_SHARING, &service->stdout_disposition, NSSM_STDERR_DISPOSITION, &service->stdout_flags, NSSM_STDERR_FLAGS)) { + if (get_createfile_parameters(key, NSSM_REG_STDERR, service->stderr_path, &service->stderr_sharing, NSSM_STDERR_SHARING, &service->stderr_disposition, NSSM_STDERR_DISPOSITION, &service->stderr_flags, NSSM_STDERR_FLAGS)) { service->stderr_sharing = service->stderr_disposition = service->stderr_flags = 0; ZeroMemory(service->stderr_path, _countof(service->stderr_path) * sizeof(TCHAR)); return 5; @@ -313,7 +313,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) { } else if (si) { if (service->rotate_files) rotate_file(service->name, service->stderr_path, service->rotate_seconds, service->rotate_bytes_low, service->rotate_bytes_high); - HANDLE stderr_handle = append_to_file(service->stderr_path, service->stdout_sharing, 0, service->stdout_disposition, service->stdout_flags); + HANDLE stderr_handle = append_to_file(service->stderr_path, service->stderr_sharing, 0, service->stderr_disposition, service->stderr_flags); if (! stderr_handle) { log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_CREATEFILE_FAILED, service->stderr_path, error_string(GetLastError()), 0); return 7; -- 2.20.1