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.
This commit is contained in:
Nebuleon Fumika 2016-06-19 19:58:02 +00:00
parent d59c7c8b35
commit 3fde6ce161

View File

@ -136,7 +136,7 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
if (!_FAT_directory_isDot (&dirContents)) {
// The directory had something in it that isn't a reference to itself or it's parent
_FAT_unlock(&partition->lock);
r->_errno = EPERM;
r->_errno = ENOTEMPTY;
return -1;
}
nextEntry = _FAT_directory_getNextEntry (partition, &dirContents);