Index: base/process_util_win.cc |
diff --git a/base/process_util_win.cc b/base/process_util_win.cc |
index c5ba392920ec5bed6489445da3355b74c4f8b3f1..2e955d02398a9f61db78ae9b9544ef73498242f7 100644 |
--- a/base/process_util_win.cc |
+++ b/base/process_util_win.cc |
@@ -71,6 +71,11 @@ long WINAPI StackDumpExceptionFilter(EXCEPTION_POINTERS* info) { |
// Connects back to a console if available. |
void AttachToConsole() { |
brettw
2012/08/19 23:26:46
Maybe just rename this one and move out of the ano
jbates
2012/08/20 17:43:00
Done.
|
+ static bool g_attached = false; |
+ if (g_attached) |
+ return; |
+ g_attached = true; |
+ |
if (!AttachConsole(ATTACH_PARENT_PROCESS)) { |
M-A Ruel
2012/08/20 12:42:29
This already takes care of not doing it 2 times in
jbates
2012/08/20 17:43:00
Done.
|
unsigned int result = GetLastError(); |
// Was probably already attached. |
@@ -167,6 +172,10 @@ void TimerExpiredTask::KillProcess() { |
} // namespace |
+void RouteStdioToConsole() { |
+ AttachToConsole(); |
+} |
+ |
ProcessId GetCurrentProcId() { |
return ::GetCurrentProcessId(); |
} |