Bug 787313 - Add back code that was erroneously reverted. r=ochameau
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 26 Sep 2012 18:56:49 -0400
changeset 108209 e4be135eff48ba0d22309e8926b91ba290e6c423
parent 108208 987f0423f403b837cabcf872aba7742eb20af2ce
child 108210 d73da596f3fd7093e72946faed3da882bb1ade01
push id23545
push useremorley@mozilla.com
push dateThu, 27 Sep 2012 10:56:50 +0000
treeherdermozilla-central@aacf4867f830 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs787313
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 787313 - Add back code that was erroneously reverted. r=ochameau
toolkit/xre/nsNativeAppSupportWin.cpp
--- a/toolkit/xre/nsNativeAppSupportWin.cpp
+++ b/toolkit/xre/nsNativeAppSupportWin.cpp
@@ -400,19 +400,21 @@ nsNativeAppSupportWin::CheckConsole() {
             // so that stdio will be displayed in it.
             if (AttachConsole(ATTACH_PARENT_PROCESS)) {
                 // Change std handles to refer to new console handles.
                 // Before doing so, ensure that stdout/stderr haven't been
                 // redirected to a valid file
                 if (_fileno(stdout) == -1 ||
                     _get_osfhandle(fileno(stdout)) == -1)
                     freopen("CONOUT$", "w", stdout);
+                // Merge stderr into CONOUT$ since there isn't any `CONERR$`.
+                // http://msdn.microsoft.com/en-us/library/windows/desktop/ms683231%28v=vs.85%29.aspx
                 if (_fileno(stderr) == -1 ||
                     _get_osfhandle(fileno(stderr)) == -1)
-                    freopen("CONERR$", "w", stderr);
+                    freopen("CONOUT$", "w", stderr);
                 if (_fileno(stdin) == -1 || _get_osfhandle(fileno(stdin)) == -1)
                     freopen("CONIN$", "r", stdin);
             }
         }
     }
 
     return;
 }