mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 17:47:59 -06:00
Use early return
This commit is contained in:
parent
f8e2119aa6
commit
c69c83b0ab
@ -118,8 +118,13 @@ WSLASession::~WSLASession()
|
||||
|
||||
void WSLASession::ConfigureStorage(const WSLA_SESSION_SETTINGS& Settings)
|
||||
{
|
||||
if (Settings.StoragePath != nullptr)
|
||||
if (Settings.StoragePath == nullptr)
|
||||
{
|
||||
// If no storage path is specified, use a tmpfs for convenience.
|
||||
m_virtualMachine->Mount("", "/root", "tmpfs", "", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
std::filesystem::path storagePath{Settings.StoragePath};
|
||||
THROW_HR_IF_MSG(E_INVALIDARG, !storagePath.is_absolute(), "Storage path is not absolute: %ls", storagePath.c_str());
|
||||
|
||||
@ -174,12 +179,6 @@ void WSLASession::ConfigureStorage(const WSLA_SESSION_SETTINGS& Settings)
|
||||
m_virtualMachine->Mount(diskDevice.c_str(), "/root", "ext4", "", 0);
|
||||
|
||||
deleteVhdOnFailure.release();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no storage path is specified, use a tmpfs for convenience.
|
||||
m_virtualMachine->Mount("", "/root", "tmpfs", "", 0);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT WSLASession::GetDisplayName(LPWSTR* DisplayName)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user