Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions fs/tmpfs/fs_tmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2896,12 +2896,20 @@ static int tmpfs_rmdir(FAR struct inode *mountpt, FAR const char *relpath)
}

/* Is the directory empty? We cannot remove directories that still
* contain references to file system objects. No can we remove the
* directory if there are outstanding references on it (other than
* our reference).
* contain references to file system objects.
*/

if (tdo->tdo_nentries > 0 || tdo->tdo_refs > 1)
if (tdo->tdo_nentries > 0)
{
ret = -ENOTEMPTY;
goto errout_with_objects;
}

/* Nor can we remove the directory if there are outstanding references on
* it (other than our reference).
*/

if (tdo->tdo_refs > 1)
{
ret = -EBUSY;
goto errout_with_objects;
Expand Down
Loading