diff options
author | marha <marha@users.sourceforge.net> | 2012-05-03 10:41:22 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-05-03 10:41:22 +0200 |
commit | a763a594aab34cdf0662859b8d2ffe5184cebf96 (patch) | |
tree | 8cdbd5d9d5aa076d1d1676df2d91e803464f5ea8 | |
parent | 29ab820c34534f18a74ddb0c39cd2ed3692c7840 (diff) | |
download | vcxsrv-a763a594aab34cdf0662859b8d2ffe5184cebf96.tar.gz vcxsrv-a763a594aab34cdf0662859b8d2ffe5184cebf96.tar.bz2 vcxsrv-a763a594aab34cdf0662859b8d2ffe5184cebf96.zip |
Silently return when _open_osfhandle returns an error
-rw-r--r-- | libwinmain/winmain.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libwinmain/winmain.c b/libwinmain/winmain.c index 4e5886397..a4ffc1102 100644 --- a/libwinmain/winmain.c +++ b/libwinmain/winmain.c @@ -44,6 +44,8 @@ static void CreateConsole(void) // redirect unbuffered STDOUT to the console lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + if (hConHandle==-1) // error occured, so return + return; fp = _fdopen( hConHandle, "w" ); *stdout = *fp; setvbuf( stdout, NULL, _IONBF, 0 ); |