Skip to content

Commit 9f829ff

Browse files
Merge pull request #4559 from geky/fat-remove-fat_filesystem_set_errno
fatfs: Remove unused fat_filesystem_set_errno function
2 parents 18b1cb6 + f158d81 commit 9f829ff

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

features/filesystem/fat/FATFileSystem.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -71,58 +71,6 @@ static int fat_error_remap(FRESULT res)
7171
}
7272
}
7373

74-
void fat_filesystem_set_errno(FRESULT res)
75-
{
76-
switch(res) {
77-
case FR_OK: /* (0) Succeeded */
78-
errno = 0; /* no error */
79-
break;
80-
case FR_DISK_ERR: /* (1) A hard error occurred in the low level disk I/O layer */
81-
case FR_NOT_READY: /* (3) The physical drive cannot work */
82-
errno = EIO; /* I/O error */
83-
break;
84-
case FR_NO_FILE: /* (4) Could not find the file */
85-
case FR_NO_PATH: /* (5) Could not find the path */
86-
case FR_INVALID_NAME: /* (6) The path name format is invalid */
87-
case FR_INVALID_DRIVE: /* (11) The logical drive number is invalid */
88-
case FR_NO_FILESYSTEM: /* (13) There is no valid FAT volume */
89-
errno = ENOENT; /* No such file or directory */
90-
break;
91-
case FR_DENIED: /* (7) Access denied due to prohibited access or directory full */
92-
errno = EACCES; /* Permission denied */
93-
break;
94-
case FR_EXIST: /* (8) Access denied due to prohibited access */
95-
errno = EEXIST; /* File exists */
96-
break;
97-
case FR_WRITE_PROTECTED: /* (10) The physical drive is write protected */
98-
case FR_LOCKED: /* (16) The operation is rejected according to the file sharing policy */
99-
errno = EACCES; /* Permission denied */
100-
break;
101-
case FR_INVALID_OBJECT: /* (9) The file/directory object is invalid */
102-
errno = EFAULT; /* Bad address */
103-
break;
104-
case FR_NOT_ENABLED: /* (12) The volume has no work area */
105-
errno = ENXIO; /* No such device or address */
106-
break;
107-
case FR_NOT_ENOUGH_CORE: /* (17) LFN working buffer could not be allocated */
108-
errno = ENOMEM; /* Not enough space */
109-
break;
110-
case FR_TOO_MANY_OPEN_FILES: /* (18) Number of open files > _FS_LOCK */
111-
errno = ENFILE; /* Too many open files in system */
112-
break;
113-
case FR_INVALID_PARAMETER: /* (19) Given parameter is invalid */
114-
errno = ENOEXEC; /* Exec format error */
115-
break;
116-
case FR_INT_ERR: /* (2) Assertion failed */
117-
case FR_MKFS_ABORTED: /* (14) The f_mkfs() aborted due to any parameter error */
118-
case FR_TIMEOUT: /* (15) Could not get a grant to access the volume within defined period */
119-
default:
120-
errno = EBADF; /* Bad file number */
121-
break;
122-
}
123-
return;
124-
}
125-
12674

12775

12876
////// Disk operations //////

0 commit comments

Comments
 (0)