diff --git a/simgear/debug/logstream.cxx b/simgear/debug/logstream.cxx index 453ad067..2dea0fba 100644 --- a/simgear/debug/logstream.cxx +++ b/simgear/debug/logstream.cxx @@ -232,13 +232,11 @@ public: if (AttachConsole(ATTACH_PARENT_PROCESS) == 0) { // attach failed, don't install the callback addStderr = false; - } - - if (!isFile) { - // No - OK! now set streams to attached console - freopen("conout$", "w", stdout); - freopen("conout$", "w", stderr); - } + } else if (!isFile) { + // No - OK! now set streams to attached console + freopen("conout$", "w", stdout); + freopen("conout$", "w", stderr); + } #endif if (addStderr) { m_callbacks.push_back(new StderrLogCallback(m_logClass, m_logPriority));