Browse Source

Terminate the correct process.

We were calling TerminateProcess() on the service process handle in
instead of the handle passed to kill_process().

Thanks Sam Townsend.
Iain Patterson 8 years ago
parent
commit
2e11a962a0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      process.cpp

+ 1 - 1
process.cpp

@@ -180,7 +180,7 @@ int kill_process(nssm_service_t *service, HANDLE process_handle, unsigned long p
 
   /* We tried being nice.  Time for extreme prejudice. */
   if (service->stop_method & NSSM_STOP_METHOD_TERMINATE) {
-    return TerminateProcess(service->process_handle, exitcode);
+    return TerminateProcess(process_handle, exitcode);
   }
 
   return 0;