s/stdout/stderr/
[nssm.git] / service.cpp
index fbbab20..1c82a38 100644 (file)
@@ -1456,7 +1456,8 @@ unsigned long WINAPI service_control_handler(unsigned long control, unsigned lon
         ZeroMemory(&service->throttle_duetime, sizeof(service->throttle_duetime));\r
         SetWaitableTimer(service->throttle_timer, &service->throttle_duetime, 0, 0, 0, 0);\r
       }\r
-      service->status.dwCurrentState = SERVICE_CONTINUE_PENDING;\r
+      /* We can't continue if the application is running! */\r
+      if (! service->process_handle) service->status.dwCurrentState = SERVICE_CONTINUE_PENDING;\r
       service->status.dwWaitHint = throttle_milliseconds(service->throttle) + NSSM_WAITHINT_MARGIN;\r
       log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_RESET_THROTTLE, service->name, 0);\r
       SetServiceStatus(service->status_handle, &service->status);\r
@@ -1473,7 +1474,7 @@ unsigned long WINAPI service_control_handler(unsigned long control, unsigned lon
     case NSSM_SERVICE_CONTROL_ROTATE:\r
       log_service_control(service->name, control, true);\r
       if (service->rotate_stdout_online) service->rotate_stdout_online = NSSM_ROTATE_ONLINE_ASAP;\r
-      if (service->rotate_stdout_online) service->rotate_stderr_online = NSSM_ROTATE_ONLINE_ASAP;\r
+      if (service->rotate_stderr_online) service->rotate_stderr_online = NSSM_ROTATE_ONLINE_ASAP;\r
       return NO_ERROR;\r
   }\r
 \r