diff options
author | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 07:24:43 +0000 |
---|---|---|
committer | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 07:24:43 +0000 |
commit | cb163554cc0eb0ae6ba35708660c46e0439dba48 (patch) | |
tree | 7a0c38cb81903fdd1a51fd4f84049077e9f441ae /base | |
parent | af113735ceb7b4105e1b018b74eac02dfa8d8e02 (diff) | |
download | chromium_src-cb163554cc0eb0ae6ba35708660c46e0439dba48.zip chromium_src-cb163554cc0eb0ae6ba35708660c46e0439dba48.tar.gz chromium_src-cb163554cc0eb0ae6ba35708660c46e0439dba48.tar.bz2 |
Revert of Fix --enable-logging after VS2013 switch (https://codereview.chromium.org/219813003/)
Reason for revert:
Speculative revert for massive failures of XP browser_tests.
http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%281%29/builds/30725
Original issue's description:
> Fix --enable-logging after VS2013 switch
>
> After https://src.chromium.org/viewvc/chrome?view=rev&revision=178656
> a valid fileno of stdout or stderr abort connection of the console to
> stdio on Windows.
>
> Looking at the VS CRT between 2010 and 2013, it seems the behavior
> that r178656 was relying on changed:
>
> (in __initstdio)
>
> C:\Program Files (x86)>diff "Microsoft Visual Studio 10.0\vc\crt\src\_file.c" "Microsoft Visual Studio 12.0\vc\crt\src\_file.c"
> 144,157d143
> < for ( i = 0 ; i < 3 ; i++ ) {
> < if ( (_osfhnd(i) == (intptr_t)INVALID_HANDLE_VALUE) ||
> < (_osfhnd(i) == _NO_CONSOLE_FILENO) ||
> < (_osfhnd(i) == 0) )
> < {
> < /*
> < * For stdin, stdout & stderr, we use _NO_CONSOLE_FILENO (a value
> < * different from _INVALID_HANDLE_VALUE to distinguish between
> < * a failure in opening a file & a program run without a console.
> < */
> < _iob[i]._file = _NO_CONSOLE_FILENO;
> < }
> < }
> <
> 194a181
> > __piob = NULL;
>
>
> There's an open bug
>
> http://connect.microsoft.com/VisualStudio/feedback/details/785119/
>
> but as it was broken in 2012 and not fixed in 2013, it doesn't look like it's
> going to be fixed. (The documentation still suggests that r178656 is correct:
> http://msdn.microsoft.com/en-us/library/zs6wbdhx(v=vs.100).aspx vs
> http://msdn.microsoft.com/en-us/library/zs6wbdhx(v=vs.120).aspx ) but that's
> little consolation.
>
> So, confirm that the underlying HANDLE is valid before aborting.
>
> TBR=brettw@chromium.org
> R=mseaborn@chromium.org
> BUG=169941, 309197, 358267
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260738
TBR=mseaborn@chromium.org,brettw@chromium.org,scottmg@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=169941, 309197, 358267
Review URL: https://codereview.chromium.org/220653002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/process/launch_win.cc | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/base/process/launch_win.cc b/base/process/launch_win.cc index 22c7555..de05255 100644 --- a/base/process/launch_win.cc +++ b/base/process/launch_win.cc @@ -63,15 +63,8 @@ void RouteStdioToConsole() { // stdout/stderr on startup (before the handle IDs can be reused). // _fileno(stdout) will return -2 (_NO_CONSOLE_FILENO) if stdout was // invalid. - if (_fileno(stdout) >= 0 || _fileno(stderr) >= 0) { - // _fileno was broken for SUBSYSTEM:WINDOWS from VS2010 to VS2012/2013. - // http://crbug.com/358267. Confirm that the underlying HANDLE is valid - // before aborting. - intptr_t stdout_handle = _get_osfhandle(_fileno(stdout)); - intptr_t stderr_handle = _get_osfhandle(_fileno(stderr)); - if (stdout_handle >= 0 || stderr_handle >= 0) - return; - } + if (_fileno(stdout) >= 0 || _fileno(stderr) >= 0) + return; if (!AttachConsole(ATTACH_PARENT_PROCESS)) { unsigned int result = GetLastError(); |