incubator-nuttx/fs
Xiang Xiao b33d967548 fs/tmpfs: Iterate the entry reversely in readdir
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
2021-01-21 15:07:01 -03:00
..
aio
binfs fs/binfs/fs_binfs.c: Fix a syslog format 2020-11-25 05:11:26 -08:00
cromfs fs/cromfs/fs_cromfs.c: Fix a syslog format 2020-11-24 22:31:33 -08:00
dirent fs: Add the relative path support 2020-09-24 03:13:27 -07:00
driver Kernel module should prefer functions with nx/kmm prefix 2021-01-13 08:57:58 +01:00
fat OS internal function should indicate the error by return negative value 2020-12-31 09:37:29 +01:00
hostfs Kernel module should prefer functions with nx/kmm prefix 2021-01-13 08:57:58 +01:00
inode fs: Remove fs_dupfd and fs_dupfd2 internal functions 2021-01-13 16:39:45 +08:00
littlefs Replace all wget with curl 2020-12-22 03:36:10 -06:00
mmap Fix nxstyle warning 2021-01-13 08:57:58 +01:00
mount fs: remove INODE_IS_SPECIAL() use others instead 2020-12-30 12:21:02 -06:00
mqueue fs: Fix the race condition in file_dup 2021-01-08 11:01:46 +08:00
nfs fs/nfs/nfs_vfsops.c: Fix syslog formats 2020-11-25 05:11:26 -08:00
nxffs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
partition Change all files come from Xiaomi/Pinecone to Apache License 2.0 2020-08-22 17:37:21 -06:00
procfs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
romfs fs/romfs/fs_romfsutil.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
semaphore
shm
smartfs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
spiffs spiffs: Document how to generate images 2021-01-06 03:06:39 -06:00
tmpfs fs/tmpfs: Iterate the entry reversely in readdir 2021-01-21 15:07:01 -03:00
unionfs fs/unionfs: remove excessive protection to avoid deadlock 2020-12-15 09:50:29 -06:00
userfs fs/userfs/fs_userfs.c: Fix syslog formats 2020-11-24 22:31:33 -08:00
vfs fs: Remove fs_dupfd and fs_dupfd2 internal functions 2021-01-13 16:39:45 +08:00
Kconfig vfs/epoll: add epoll_create1(2) implement 2020-08-17 23:41:13 -05:00
Makefile style/Makefile: remove unnecessary trailing whitespace 2020-11-28 12:20:30 +01:00
fs_initialize.c