X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=sidebyside;f=process.cpp;h=75956de7556a758cae86a52df34424761348945c;hb=fa2f3fe4a81e6958717ae05f6d37af2da91bcd66;hp=69aea030a5d60e5950843cc2ac5f28207df759fc;hpb=135329c0790e6d33f658727be3e5439a167a7da8;p=nssm.git diff --git a/process.cpp b/process.cpp index 69aea03..75956de 100644 --- a/process.cpp +++ b/process.cpp @@ -149,6 +149,13 @@ int kill_process(nssm_service_t *service, HANDLE process_handle, unsigned long p kill_t k = { pid, exitcode, 0 }; + /* Close the stdin pipe. */ + if (service->stdin_pipe) { + CloseHandle(service->stdin_pipe); + service->stdin_pipe = 0; + if (! await_shutdown(service, _T(__FUNCTION__), service->kill_console_delay)) return 1; + } + /* Try to send a Control-C event to the console. */ if (service->stop_method & NSSM_STOP_METHOD_CONSOLE) { if (! kill_console(service)) return 1; @@ -314,7 +321,7 @@ void kill_process_tree(nssm_service_t *service, unsigned long pid, unsigned long -1 on error. */ int test_environment(TCHAR *env) { - TCHAR path[MAX_PATH]; + TCHAR path[PATH_LENGTH]; GetModuleFileName(0, path, _countof(path)); STARTUPINFO si; ZeroMemory(&si, sizeof(si));