diff --git a/eden/common/utils/SpawnedProcess.cpp b/eden/common/utils/SpawnedProcess.cpp index 411bc35..3e9770c 100644 --- a/eden/common/utils/SpawnedProcess.cpp +++ b/eden/common/utils/SpawnedProcess.cpp @@ -593,21 +593,19 @@ SpawnedProcess::SpawnedProcess( if (!startupInfo.StartupInfo.hStdInput) { startupInfo.StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - if (startupInfo.StartupInfo.hStdError == INVALID_HANDLE_VALUE) { + if (startupInfo.StartupInfo.hStdInput == INVALID_HANDLE_VALUE) { auto err = makeWin32ErrorExplicit( GetLastError(), "GetStdHandle(STD_INPUT_HANDLE) failed"); XLOGF( ERR, - "Issue during SpawnedProcess Creation: {}", + "Issue during SpawnedProcess creation: {}", folly::exceptionStr(err)); } - // Continue anyway; TODO(cuev): Determine if throwing immediately is the - // better option handles.push_back(startupInfo.StartupInfo.hStdInput); } if (!startupInfo.StartupInfo.hStdOutput) { startupInfo.StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - if (startupInfo.StartupInfo.hStdError == INVALID_HANDLE_VALUE) { + if (startupInfo.StartupInfo.hStdOutput == INVALID_HANDLE_VALUE) { auto err = makeWin32ErrorExplicit( GetLastError(), "GetStdHandle(STD_OUTPUT_HANDLE) failed"); XLOGF( @@ -615,8 +613,6 @@ SpawnedProcess::SpawnedProcess( "Issue during SpawnedProcess Creation: {}", folly::exceptionStr(err)); } - // Continue anyway; TODO(cuev): Determine if throwing immediately is the - // better option handles.push_back(startupInfo.StartupInfo.hStdOutput); } if (!startupInfo.StartupInfo.hStdError) { @@ -629,8 +625,6 @@ SpawnedProcess::SpawnedProcess( "Issue during SpawnedProcess Creation: {}", folly::exceptionStr(err)); } - // Continue anyway; TODO(cuev): Determine if throwing immediately is the - // better option handles.push_back(startupInfo.StartupInfo.hStdError); } @@ -702,33 +696,17 @@ SpawnedProcess::SpawnedProcess( auto err = makeWin32ErrorExplicit( errorCode, fmt::format( - "CreateProcess({}) failed with cwd: {}, creation flags: {}, execPath: {}, env: {}", + "CreateProcess({}) failed with cwd: {}, creation flags: {}, execPath: {}", wideToMultibyteString(cmdLine), options.cwd_.has_value() ? options.cwd_->viewWithoutUNC() : "(no cwd provided)", options.flags_.value_or(0), options.execPath_.has_value() ? options.execPath_->view() - : "(no execPath provided)", - env)); - XLOG(ERR) << folly::exceptionStr(err); + : "(no execPath provided)")); + XLOG(ERR, folly::exceptionStr(err)); throw err; } - // Some times this code inexplicably fails with "The parameter is incorrect" - // error. To understand what successful CreateProcess() calls look like, we - // will temporarily add logging. - // TODO(cuev): Remove this logging once we get some data. - XLOGF( - DBG2, - "CreateProcess({}) succeeded with cwd: {}, creation flags: {}, execPath: {}, env: {}", - wideToMultibyteString(cmdLine), - options.cwd_.has_value() ? options.cwd_->viewWithoutUNC() - : "(no cwd provided)", - options.flags_.value_or(0), - options.execPath_.has_value() ? options.execPath_->view() - : "(no execPath provided)", - env); - CloseHandle(procInfo.hThread); proc_.reset(procInfo.hProcess); #endif