From 83ca413027120222f01dfd6238d30e08c0b5fc30 Mon Sep 17 00:00:00 2001 From: V10lator Date: Wed, 22 Jul 2020 04:23:29 +0200 Subject: [PATCH] Translate more FSErrors to errnos (#150) --- libraries/wutdevoptab/devoptab_fs_utils.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libraries/wutdevoptab/devoptab_fs_utils.c b/libraries/wutdevoptab/devoptab_fs_utils.c index f3d8d05..a932bed 100644 --- a/libraries/wutdevoptab/devoptab_fs_utils.c +++ b/libraries/wutdevoptab/devoptab_fs_utils.c @@ -43,12 +43,34 @@ __wut_fs_translate_error(FSStatus error) return EINVAL; case FS_STATUS_EXISTS: return EEXIST; + case FS_STATUS_MEDIA_ERROR: + return EIO; case FS_STATUS_NOT_FOUND: return ENOENT; + case FS_STATUS_PERMISSION_ERROR: + return EPERM; case FS_STATUS_STORAGE_FULL: return ENOSPC; + case FS_ERROR_ALREADY_EXISTS: + return EEXIST; + case FS_ERROR_BUSY: + return EBUSY; + case FS_ERROR_CANCELLED: + return ECANCELED; + case FS_STATUS_FILE_TOO_BIG: + return EFBIG; case FS_ERROR_INVALID_PATH: return ENAMETOOLONG; + case FS_ERROR_NOT_DIR: + return ENOTDIR; + case FS_ERROR_NOT_FILE: + return EISDIR; + case FS_ERROR_OUT_OF_RANGE: + return ESPIPE; + case FS_ERROR_UNSUPPORTED_COMMAND: + return ENOTSUP; + case FS_ERROR_WRITE_PROTECTED: + return EROFS; default: return (int)error; }