Skip to content

Commit 5efda4b

Browse files
committed
fatfs: Fixed ENOTEMPTY error for removing a directory
1 parent 6d4190b commit 5efda4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

features/filesystem/fat/FATFileSystem.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ int FATFileSystem::remove(const char *path)
404404

405405
if (res != FR_OK) {
406406
debug_if(FFS_DBG, "f_unlink() failed: %d\n", res);
407+
if (res == FR_DENIED) {
408+
printf("hi %d -> %d\n", FR_DENIED, -ENOTEMPTY);
409+
return -ENOTEMPTY;
410+
}
407411
}
408412
return fat_error_remap(res);
409413
}

0 commit comments

Comments
 (0)