Improve lock-related code in conductbuild.cpp

This commit is contained in:
Martchus 2021-03-02 18:30:40 +01:00
parent 4416922397
commit 556a749362
1 changed files with 2 additions and 1 deletions

View File

@ -942,7 +942,8 @@ InvocationResult ConductBuild::invokeMakechrootpkg(
buildRoot + "/etc/pacman.conf", std::filesystem::copy_options::overwrite_existing);
std::filesystem::copy_file(m_makepkgConfigPath, buildRoot + "/etc/makepkg.conf", std::filesystem::copy_options::overwrite_existing);
} catch (const std::filesystem::filesystem_error &e) {
auto writeLock = lockToWrite(lock);
chrootLock.lock().unlock();
const auto writeLock = lockToWrite(lock);
packageProgress.error = "Unable to configure chroot \"" % buildRoot % "\": " + e.what();
return InvocationResult::Error;
}