mirror of
https://github.com/apache/nuttx.git
synced 2026-10-20 21:28:47 +00:00
MIRTOS-342
to avoid readdir return the wrong entry in the following code:
void rmdir_recursive(FAR const char *path)
{
FAR DIR *dir = opendir(path);
while (1)
{
char fullpath[MAX_PATH];
FAR dirent *ent = readdir(dir);
if (ent == NULL)
{
break;
}
sprintf(fullpath, "%s/%s", path, ent->d_name);
if (DIRENT_ISDIRECTORY(ent->d_type))
{
rmdir_recursive(fullpath);
}
else
{
unlink(fullpath);
}
}
}
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ide60fe8db6aada88ad3d8e45367f11599a6f33b1
|
||
|---|---|---|
| .. | ||
| aio | ||
| binfs | ||
| cromfs | ||
| dirent | ||
| driver | ||
| fat | ||
| hostfs | ||
| inode | ||
| littlefs | ||
| mmap | ||
| mount | ||
| mqueue | ||
| nfs | ||
| nxffs | ||
| partition | ||
| procfs | ||
| romfs | ||
| semaphore | ||
| shm | ||
| smartfs | ||
| spiffs | ||
| tmpfs | ||
| unionfs | ||
| userfs | ||
| vfs | ||
| fs_initialize.c | ||
| Kconfig | ||
| Makefile | ||