aboutsummaryrefslogtreecommitdiff
path: root/libwinmain/winmain.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-03 10:41:22 +0200
committermarha <marha@users.sourceforge.net>2012-05-03 10:41:22 +0200
commita763a594aab34cdf0662859b8d2ffe5184cebf96 (patch)
tree8cdbd5d9d5aa076d1d1676df2d91e803464f5ea8 /libwinmain/winmain.c
parent29ab820c34534f18a74ddb0c39cd2ed3692c7840 (diff)
downloadvcxsrv-a763a594aab34cdf0662859b8d2ffe5184cebf96.tar.gz
vcxsrv-a763a594aab34cdf0662859b8d2ffe5184cebf96.tar.bz2
vcxsrv-a763a594aab34cdf0662859b8d2ffe5184cebf96.zip
Silently return when _open_osfhandle returns an error
Diffstat (limited to 'libwinmain/winmain.c')
-rw-r--r--libwinmain/winmain.c2
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 );