Terminate the correct process.
authorIain Patterson <me@iain.cx>
Sun, 31 Aug 2014 15:08:56 +0000 (16:08 +0100)
committerIain Patterson <me@iain.cx>
Sun, 31 Aug 2014 15:08:56 +0000 (16:08 +0100)
We were calling TerminateProcess() on the service process handle in
instead of the handle passed to kill_process().

Thanks Sam Townsend.

process.cpp

index daeeea7..624111c 100644 (file)
@@ -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;