mirror of https://github.com/PCSX2/pcsx2.git
It seems trying to second-guess win32api plays against you, so it's best to assume it worked when the functions say it did.
(Fixes the stdout redirection for me.) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2020 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
1ae5d07a3f
commit
bdad3bfa97
|
@ -208,14 +208,9 @@ WinPipeRedirection::WinPipeRedirection( FILE* stdstream ) :
|
|||
throw Exception::Win32Error( "SetStdHandle failed." );
|
||||
|
||||
// In some cases GetStdHandle can fail, even when the one we just assigned above is valid.
|
||||
HANDLE newhandle = GetStdHandle(stdhandle);
|
||||
if( newhandle == INVALID_HANDLE_VALUE )
|
||||
throw Exception::Win32Error( "GetStdHandle failed." );
|
||||
// Regardless, it seems to work right so if SetStdHandle was successful, assume it worked.
|
||||
|
||||
if( newhandle == NULL )
|
||||
throw Exception::RuntimeError( "GetStdHandle returned NULL." ); // not a Win32error (no error code)
|
||||
|
||||
m_crtFile = _open_osfhandle( (intptr_t)newhandle, _O_TEXT );
|
||||
m_crtFile = _open_osfhandle( (intptr_t)m_writepipe, _O_TEXT );
|
||||
if( m_crtFile == -1 )
|
||||
throw Exception::RuntimeError( "_open_osfhandle returned -1." );
|
||||
|
||||
|
|
Loading…
Reference in New Issue