Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/linux/init/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,6 @@ Return Value:

--*/

try
{
std::vector<std::string> Variables;
auto AddEnvironmentVariable = [&Variables](const char* Name, const char* Value) {
Expand All @@ -1500,7 +1499,7 @@ try
{
THROW_LAST_ERROR_IF(TEMP_FAILURE_RETRY(dup2(SocketFd, LX_INIT_UTILITY_VM_INIT_SOCKET_FD)) < 0);

close(SocketFd);
THROW_LAST_ERROR_IF(SetCloseOnExec(SocketFd, true));
Comment thread
chemwolf6922 marked this conversation as resolved.
SocketFd = LX_INIT_UTILITY_VM_INIT_SOCKET_FD;
}
else
Expand Down Expand Up @@ -1661,11 +1660,6 @@ try
LOG_ERROR("execle({}) failed {}", LX_INIT_PATH, errno);
_exit(1);
}
catch (...)
{
LOG_CAUGHT_EXCEPTION();
_exit(1);
}

void LaunchSystemDistro(
int SocketFd,
Expand Down Expand Up @@ -2381,6 +2375,7 @@ void ProcessLaunchInitMessage(
}
catch (...)
{
LOG_CAUGHT_EXCEPTION();
ReportStatus(wil::ResultFromCaughtException());
_exit(1);
}
Expand Down
4 changes: 3 additions & 1 deletion src/windows/service/exe/WslCoreInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ WslCoreInstance::WslCoreInstance(
if (result.Result != 0)
{
// N.B. EFSBADCRC (74) or EFSCORRUPTED (117) can be returned if the disk's journal is corrupted.
if ((result.Result == EINVAL || result.Result == 74 || result.Result == 117) && result.FailureStep == LxInitCreateInstanceStepMountDisk)
// EIO (5) can be returned during LaunchInit if corruption is detected after the initial mount succeeds.
if (((result.Result == EINVAL || result.Result == 74 || result.Result == 117) && result.FailureStep == LxInitCreateInstanceStepMountDisk) ||
(result.Result == 5 && result.FailureStep == LxInitCreateInstanceStepLaunchInit))
{
THROW_HR(WSL_E_DISK_CORRUPTED);
}
Expand Down