libc: Change errno to set_errno and get_errno

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2023-10-18 09:17:28 +08:00
committed by Petro Karashchenko
parent f911d3a1c3
commit 7aad7eebff
11 changed files with 29 additions and 28 deletions
+3 -3
View File
@@ -55,9 +55,9 @@ int remove(FAR const char *path)
* more frequently the necessary action.
*/
if (unlink(path) != 0 /* If it is indeed a directory... */
&& (errno != EPERM /* ...try to remove it. */
|| rmdir(path) != 0))
if (unlink(path) != 0 && /* If it is indeed a directory... */
(get_errno() != EPERM || /* ...try to remove it. */
rmdir(path) != 0))
{
/* Cannot remove the object for whatever reason. */