we might want an OK

This commit is contained in:
Marius Eggert 2024-03-05 14:09:40 +01:00
parent c2d8ef9fe4
commit aa4bfa8d88

View File

@ -2114,13 +2114,17 @@ ReturnValue_t CoreController::initLeapSecondsFromFile() {
ReturnValue_t CoreController::writeLeapSecondsToFile(const uint16_t leapSeconds) {
std::string fileName = currMntPrefix + LEAP_SECONDS_FILE;
if (sdcMan->isSdCardUsable(std::nullopt)) {
std::ofstream leapSecondsFile(fileName.c_str(), std::ofstream::out | std::ofstream::trunc);
if (leapSecondsFile.is_open()) {
leapSecondsFile << "LEAP SECONDS: " << leapSeconds << std::endl;
}
}
if (not sdcMan->isSdCardUsable(std::nullopt)) {
return returnvalue::FAILED;
}
std::ofstream leapSecondsFile(fileName.c_str(), std::ofstream::out | std::ofstream::trunc);
if (not leapSecondsFile.good()) {
sif::error << "CoreController::leapSecondsFileHandler: Error opening time file: "
<< strerror(errno) << std::endl;
return returnvalue::FAILED;
}
leapSecondsFile << "LEAP SECONDS: " << leapSeconds << std::endl;
return returnvalue::OK;
};
ReturnValue_t CoreController::actionUpdateLeapSeconds(const uint8_t *data) {