From 0cdcb9f8e42b6a55242c13719b0c497cfa5a8b35 Mon Sep 17 00:00:00 2001 From: Iris Morelle Date: Sun, 12 Jan 2020 21:41:24 -0300 Subject: [PATCH] log/windows: Ignore failure to attach or allocate a console Wine as of version 4.21 just refuses and goes ERROR_ACCESS_DENIED when trying to allocate a console for a GUI subsystem application. Why? Who knows. It does have the functionality to run console applications either using ncurses or its own console implementation, but it won't. It's best not to dwell on it and just ignore what's supposed to be the unlikeliest worst case scenario. --- src/log_windows.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/log_windows.cpp b/src/log_windows.cpp index a7154a2a7b5..817d3d27f59 100644 --- a/src/log_windows.cpp +++ b/src/log_windows.cpp @@ -421,8 +421,12 @@ void log_file_manager::enable_native_console_output() LOG_LS << "Allocated own console.\n"; created_wincon_ = true; } else { - ERR_LS << "Console attachment or allocation failed!\n"; - return; + // Wine as of version 4.21 just goes ERROR_ACCESS_DENIED when trying + // to allocate a console for a GUI subsystem application. We can ignore + // this since the user purportedly knows what they're doing and if they + // get radio silence from Wesnoth and no log files they'll realize that + // something went wrong. + WRN_LS << "Cannot attach or allocate a console, continuing anyway (is this Wine?)\n"; } DBG_LS << "stderr to console\n";