summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-03-07 19:04:34 -0800
committerDave SIMmONs <simon@lindenlab.com>2011-03-07 19:04:34 -0800
commit4de2797dbd1cb1cea09acf653af7a49c88590057 (patch)
treeddb779fbe37003e8d0c92c992cc93d5df127bd7a /indra/newview/llappviewerwin32.cpp
parent627c28da811f00ddd02a5c2af0762f427ac02a1b (diff)
parent9a9f813c2f1292942c8cc8fcde9c48ed2ca31f42 (diff)
Merge
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r--indra/newview/llappviewerwin32.cpp41
1 files changed, 32 insertions, 9 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index d328567a0e..2fbec6e49e 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -301,23 +301,44 @@ void create_console()
// redirect unbuffered STDOUT to the console
l_std_handle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
- fp = _fdopen( h_con_handle, "w" );
- *stdout = *fp;
- setvbuf( stdout, NULL, _IONBF, 0 );
+ if (h_con_handle == -1)
+ {
+ llwarns << "create_console() failed to open stdout handle" << llendl;
+ }
+ else
+ {
+ fp = _fdopen( h_con_handle, "w" );
+ *stdout = *fp;
+ setvbuf( stdout, NULL, _IONBF, 0 );
+ }
// redirect unbuffered STDIN to the console
l_std_handle = (long)GetStdHandle(STD_INPUT_HANDLE);
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
- fp = _fdopen( h_con_handle, "r" );
- *stdin = *fp;
- setvbuf( stdin, NULL, _IONBF, 0 );
+ if (h_con_handle == -1)
+ {
+ llwarns << "create_console() failed to open stdin handle" << llendl;
+ }
+ else
+ {
+ fp = _fdopen( h_con_handle, "r" );
+ *stdin = *fp;
+ setvbuf( stdin, NULL, _IONBF, 0 );
+ }
// redirect unbuffered STDERR to the console
l_std_handle = (long)GetStdHandle(STD_ERROR_HANDLE);
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
- fp = _fdopen( h_con_handle, "w" );
- *stderr = *fp;
- setvbuf( stderr, NULL, _IONBF, 0 );
+ if (h_con_handle == -1)
+ {
+ llwarns << "create_console() failed to open stderr handle" << llendl;
+ }
+ else
+ {
+ fp = _fdopen( h_con_handle, "w" );
+ *stderr = *fp;
+ setvbuf( stderr, NULL, _IONBF, 0 );
+ }
}
LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) :
@@ -363,8 +384,10 @@ bool LLAppViewerWin32::initLogging()
void LLAppViewerWin32::initConsole()
{
+ llinfos << "Test before create_console" << llendl;
// pop up debug console
create_console();
+ llinfos << "Test after create_console" << llendl;
return LLAppViewer::initConsole();
}