Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit 3fde6ce

Browse files
committed
Set errno to ENOTEMPTY when removing a non-empty directory
The value that was previously set, EPERM, implies that the user didn't have the (write) permission to remove the directory.
1 parent d59c7c8 commit 3fde6ce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/fatdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
136136
if (!_FAT_directory_isDot (&dirContents)) {
137137
// The directory had something in it that isn't a reference to itself or it's parent
138138
_FAT_unlock(&partition->lock);
139-
r->_errno = EPERM;
139+
r->_errno = ENOTEMPTY;
140140
return -1;
141141
}
142142
nextEntry = _FAT_directory_getNextEntry (partition, &dirContents);

0 commit comments

Comments
 (0)