diff --git a/tools/server/server-tools.cpp b/tools/server/server-tools.cpp index 1b3ec4dcac..984bb478ea 100644 --- a/tools/server/server-tools.cpp +++ b/tools/server/server-tools.cpp @@ -1094,9 +1094,6 @@ struct server_tool_get_datetime : server_tool { // get_info: returns runtime info (OS name/version and cwd) // -static constexpr size_t SERVER_TOOL_GET_INFO_MAX_OUTPUT = 4 * 1024; // 4 KB -static constexpr int SERVER_TOOL_GET_INFO_TIMEOUT = 5; // seconds - struct server_tool_get_info : server_tool { server_tool_get_info() { name = "get_info"; @@ -1122,9 +1119,9 @@ struct server_tool_get_info : server_tool { auto io = make_tools_io(params); #ifdef _WIN32 - auto res = io->run({"cmd", "/c", "ver"}, SERVER_TOOL_GET_INFO_MAX_OUTPUT, SERVER_TOOL_GET_INFO_TIMEOUT); + auto res = io->run({"cmd", "/c", "ver"}, 4096, 5); #else - auto res = io->run({"uname", "-a"}, SERVER_TOOL_GET_INFO_MAX_OUTPUT, SERVER_TOOL_GET_INFO_TIMEOUT); + auto res = io->run({"uname", "-a"}, 4096, 5); #endif // "ver" prints a blank line before the version, so the output is stripped on both ends; // a failed spawn or a timeout leaves a diagnostic in res.output, which is not an OS name @@ -1134,9 +1131,6 @@ struct server_tool_get_info : server_tool { if (cwd.empty()) { std::error_code ec; cwd = fs::current_path(ec).string(); - if (ec) { - cwd = "unknown"; - } } return {