Don't create std log file for out of process when logs are disabled (#640)
This commit is contained in:
parent
419ae06935
commit
4eea754dc3
|
|
@ -980,6 +980,14 @@ SERVER_PROCESS::SetupStdHandles(
|
||||||
|
|
||||||
DBG_ASSERT(pStartupInfo);
|
DBG_ASSERT(pStartupInfo);
|
||||||
|
|
||||||
|
if (!m_fStdoutLogEnabled)
|
||||||
|
{
|
||||||
|
pStartupInfo->dwFlags = STARTF_USESTDHANDLES;
|
||||||
|
pStartupInfo->hStdInput = INVALID_HANDLE_VALUE;
|
||||||
|
pStartupInfo->hStdError = INVALID_HANDLE_VALUE;
|
||||||
|
pStartupInfo->hStdOutput = INVALID_HANDLE_VALUE;
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
if (m_hStdoutHandle != NULL && m_hStdoutHandle != INVALID_HANDLE_VALUE)
|
if (m_hStdoutHandle != NULL && m_hStdoutHandle != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
if (!CloseHandle(m_hStdoutHandle))
|
if (!CloseHandle(m_hStdoutHandle))
|
||||||
|
|
@ -1038,22 +1046,12 @@ SERVER_PROCESS::SetupStdHandles(
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_fStdoutLogEnabled)
|
pStartupInfo->dwFlags = STARTF_USESTDHANDLES;
|
||||||
{
|
pStartupInfo->hStdInput = INVALID_HANDLE_VALUE;
|
||||||
pStartupInfo->dwFlags = STARTF_USESTDHANDLES;
|
pStartupInfo->hStdError = m_hStdoutHandle;
|
||||||
pStartupInfo->hStdInput = INVALID_HANDLE_VALUE;
|
pStartupInfo->hStdOutput = m_hStdoutHandle;
|
||||||
pStartupInfo->hStdError = m_hStdoutHandle;
|
// start timer to open and close handles regularly.
|
||||||
pStartupInfo->hStdOutput = m_hStdoutHandle;
|
m_Timer.InitializeTimer(STTIMER::TimerCallback, &m_struFullLogFile, 3000, 3000);
|
||||||
// start timer to open and close handles regularly.
|
|
||||||
m_Timer.InitializeTimer(STTIMER::TimerCallback, &m_struFullLogFile, 3000, 3000);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // only enable stderr
|
|
||||||
pStartupInfo->dwFlags = STARTF_USESTDHANDLES;
|
|
||||||
pStartupInfo->hStdInput = INVALID_HANDLE_VALUE;
|
|
||||||
pStartupInfo->hStdError = m_hStdoutHandle;
|
|
||||||
pStartupInfo->hStdOutput = INVALID_HANDLE_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Finished:
|
Finished:
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue