Skip to content

Define error codes in terms of errno values #1190

@ssilverman

Description

@ssilverman

littlefs/lfs.h

Line 70 in adad0fb

enum lfs_error {

I was going through the LFS error codes and noticed that a few values don't match my system:

Error LFS errno from GCC arm-none-eabi
LFS_ERR_NOTEMPTY -39 90
LFS_ERR_NAMETOOLONG -36 91

May I suggest defining the LFS_ERR_* values in terms of the errno values from errno.h? This way, the system would always match, and there'd be no reason to write a custom mapping function that maps from LFS_ERR_* to system errno values.

Then, I could take all return values, check them for being negative, and setting errno to the negative of that value without a map.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions