mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
libc: Change errno to set_errno and get_errno
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
f911d3a1c3
commit
7aad7eebff
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user