X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=io.cpp;h=3ba919a0fabe2ca4976b3a3d85c0319d6216886b;hb=b0a6672810ee06052dc3dcf268274d06f0e82a50;hp=41139a099a8d887926eb34f9786d62a5025a5e6a;hpb=c03d51cbbfe9f4f8a28dbabbfc068573a1842b74;p=nssm.git diff --git a/io.cpp b/io.cpp index 41139a0..3ba919a 100644 --- a/io.cpp +++ b/io.cpp @@ -232,25 +232,7 @@ void rotate_file(TCHAR *service_name, TCHAR *path, unsigned long seconds, unsign int get_output_handles(nssm_service_t *service, HKEY key, STARTUPINFO *si) { /* Allocate a new console so we get a fresh stdin, stdout and stderr. */ - if (si && ! service->no_console) { - FreeConsole(); - AllocConsole(); - banner(); - - /* Set a title like "[NSSM] Jenkins" */ - TCHAR displayname[SERVICE_NAME_LENGTH]; - unsigned long len = _countof(displayname); - SC_HANDLE services = open_service_manager(); - if (services) { - if (! GetServiceDisplayName(services, service->name, displayname, &len)) ZeroMemory(displayname, sizeof(displayname)); - CloseServiceHandle(services); - } - if (! displayname[0]) _sntprintf_s(displayname, _countof(displayname), _TRUNCATE, _T("%s"), service->name); - - TCHAR title[65535]; - _sntprintf_s(title, _countof(title), _TRUNCATE, _T("[%s] %s"), NSSM, displayname); - SetConsoleTitle(title); - } + if (si) alloc_console(service); /* stdin */ if (get_createfile_parameters(key, NSSM_REG_STDIN, service->stdin_path, &service->stdin_sharing, NSSM_STDIN_SHARING, &service->stdin_disposition, NSSM_STDIN_DISPOSITION, &service->stdin_flags, NSSM_STDIN_FLAGS)) {