소스 검색

Changed LFS_ERR_CORRUPT to match EILSEQ instead of EBADE

LFS_ERR_CORRUPT is unfortunately not a well defined error code. It's
very important in the context of littlefs, but missing from the standard
error codes defined in Linux.

After some discussions with other developers, it was encouraged to use
the encoding for EILSEQ over EBADE for representing on disk corrupt, as
EILSEQ implies that there is something wrong with the data.

I've changed this now to take advantage of the breaking changes in v2 to
avoid a risky change to a return value.
Christopher Haster 7 년 전
부모
커밋
213530c376
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lfs.h

+ 1 - 1
lfs.h

@@ -78,7 +78,7 @@ typedef uint32_t lfs_block_t;
 enum lfs_error {
     LFS_ERR_OK          = 0,    // No error
     LFS_ERR_IO          = -5,   // Error during device operation
-    LFS_ERR_CORRUPT     = -52,  // Corrupted
+    LFS_ERR_CORRUPT     = -84,  // Corrupted
     LFS_ERR_NOENT       = -2,   // No directory entry
     LFS_ERR_EXIST       = -17,  // Entry already exists
     LFS_ERR_NOTDIR      = -20,  // Entry is not a dir