From 2697ebeb215c7fe1c6954249f70374774643133d Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 29 Apr 2018 16:14:01 +0300 Subject: [PATCH] littlefs: Map LFS_ERR_CORRUPT to EILSEQ Previously EBAD (invalid exchange), mapping the error CORRUPT to EILSEQ (illegal byte sequence) makes more sense as a description of the type of error. --- features/filesystem/littlefs/LittleFileSystem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/features/filesystem/littlefs/LittleFileSystem.cpp b/features/filesystem/littlefs/LittleFileSystem.cpp index d60d972f7c..b1bb93b6b5 100644 --- a/features/filesystem/littlefs/LittleFileSystem.cpp +++ b/features/filesystem/littlefs/LittleFileSystem.cpp @@ -35,6 +35,7 @@ static int lfs_toerror(int err) case LFS_ERR_INVAL: return -EINVAL; case LFS_ERR_NOSPC: return -ENOSPC; case LFS_ERR_NOMEM: return -ENOMEM; + case LFS_ERR_CORRUPT: return -EILSEQ; default: return err; } }