forked from OSchip/llvm-project
[Reproducer] Surface error if setting the cwd fails
Make sure that we surface an error if setting the current working directory fails during replay. llvm-svn: 375146
This commit is contained in:
parent
e19dfa6745
commit
2b7899b730
|
@ -80,8 +80,13 @@ llvm::Error SystemInitializerCommon::Initialize() {
|
|||
}
|
||||
if (llvm::Expected<std::string> cwd =
|
||||
loader->LoadBuffer<WorkingDirectoryProvider>()) {
|
||||
FileSystem::Instance().GetVirtualFileSystem()->setCurrentWorkingDirectory(
|
||||
*cwd);
|
||||
cwd->erase(std::remove_if(cwd->begin(), cwd->end(), std::iscntrl),
|
||||
cwd->end());
|
||||
if (std::error_code ec = FileSystem::Instance()
|
||||
.GetVirtualFileSystem()
|
||||
->setCurrentWorkingDirectory(*cwd)) {
|
||||
return llvm::errorCodeToError(ec);
|
||||
}
|
||||
} else {
|
||||
return cwd.takeError();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue