Fixed copy/paste bug with I/O.
authorIain Patterson <me@iain.cx>
Sun, 12 Jan 2014 23:02:23 +0000 (23:02 +0000)
committerIain Patterson <me@iain.cx>
Sun, 12 Jan 2014 23:02:23 +0000 (23:02 +0000)
The stderr file was incorrectly being created with stdout paramters.

io.cpp

diff --git a/io.cpp b/io.cpp
index 0fbc4e4..2602dc2 100644 (file)
--- a/io.cpp
+++ b/io.cpp
@@ -290,7 +290,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {
   }\r
 \r
   /* stderr */\r
-  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)) {\r
+  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)) {\r
     service->stderr_sharing = service->stderr_disposition = service->stderr_flags = 0;\r
     ZeroMemory(service->stderr_path, _countof(service->stderr_path) * sizeof(TCHAR));\r
     return 5;\r
@@ -313,7 +313,7 @@ int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) {
     }\r
     else if (si) {\r
       if (service->rotate_files) rotate_file(service->name, service->stderr_path, service->rotate_seconds, service->rotate_bytes_low, service->rotate_bytes_high);\r
-      HANDLE stderr_handle = append_to_file(service->stderr_path, service->stdout_sharing, 0, service->stdout_disposition, service->stdout_flags);\r
+      HANDLE stderr_handle = append_to_file(service->stderr_path, service->stderr_sharing, 0, service->stderr_disposition, service->stderr_flags);\r
       if (! stderr_handle) {\r
         log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_CREATEFILE_FAILED, service->stderr_path, error_string(GetLastError()), 0);\r
         return 7;\r