Work around bug in littlefs rename() for now. After upstream change to version 2.5 this can be reverted.

This commit is contained in:
Thomas Göttgens
2022-08-04 09:08:02 +02:00
parent 7b438cd16b
commit 295dca8415
3 changed files with 42 additions and 1 deletions

View File

@@ -414,7 +414,7 @@ bool saveProto(const char *filename, size_t protoSize, size_t objSize, const pb_
// brief window of risk here ;-)
if (FSCom.exists(filename) && !FSCom.remove(filename))
DEBUG_MSG("Warning: Can't remove old pref file\n");
if (!FSCom.rename(filenameTmp.c_str(), filename))
if (!renameFile(filenameTmp.c_str(), filename))
DEBUG_MSG("Error: can't rename new pref file\n");
} else {
DEBUG_MSG("Can't write prefs\n");