use existing console if available

This commit is contained in:
radius 2016-10-14 00:57:15 -05:00
parent fec6ed0964
commit 5cbb3f33f8

View File

@ -323,8 +323,11 @@ static uint64_t frontend_win32_get_mem_used(void)
static void frontend_win32_attach_console(void)
{
#ifdef _WIN32
if (!AttachConsole(ATTACH_PARENT_PROCESS))
{
AllocConsole();
AttachConsole( GetCurrentProcessId()) ;
}
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
#endif