From 3fde6ce161db5293a302ef5b839483065526c3b5 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 19 Jun 2016 19:58:02 +0000 Subject: [PATCH] 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. --- source/fatdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/fatdir.c b/source/fatdir.c index fe0e781..435d85b 100644 --- a/source/fatdir.c +++ b/source/fatdir.c @@ -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);