From 6040cd2d1ed3de7e98c45e2a26e4641d3fa8b62e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 24 Jun 2023 18:48:12 +0200 Subject: [PATCH] some important tweaks --- bsp_q7s/core/CoreController.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index b3f91506..9bd323a0 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -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(file.mechanismNextChip) << " " << static_cast(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; + } } }