some important tweaks
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-06-24 18:48:12 +02:00
parent 4e7b774d32
commit 6040cd2d1e
Signed by: muellerr
GPG Key ID: A649FB78196E3849

View File

@ -1637,7 +1637,10 @@ void CoreController::performRebootWatchdogHandling(bool recreateFile) {
// TODO: Remove at some point in the future.
if (std::filesystem::exists(legacyPath)) {
// Old file might still exist, so copy it to new path
std::filesystem::copy(legacyPath, path);
std::filesystem::copy(legacyPath, path, std::filesystem::copy_options::overwrite_existing, e);
if (e) {
sif::error << "File copy has failed: " << e.message() << std::endl;
}
}
if (not std::filesystem::exists(path, e) or recreateFile) {
#if OBSW_VERBOSE_LEVEL >= 1
@ -2145,10 +2148,14 @@ void CoreController::rewriteRebootWatchdogFile(RebootWatchdogFile file) {
<< "\nnext: " << static_cast<int>(file.mechanismNextChip) << " "
<< static_cast<int>(file.mechanismNextCopy) << "\n";
}
std::error_code e;
// TODO: Remove at some point in the future when all images have been updated.
if (std::filesystem::exists(legacyPath)) {
// Keep those two files in sync
std::filesystem::copy(path, legacyPath);
std::filesystem::copy(path, legacyPath, std::filesystem::copy_options::overwrite_existing, e);
if (e) {
sif::error << "File copy has failed: " << e.message() << std::endl;
}
}
}