diff --git a/libs/libc/stdio/lib_remove.c b/libs/libc/stdio/lib_remove.c index 650ac82da9..89a965092c 100644 --- a/libs/libc/stdio/lib_remove.c +++ b/libs/libc/stdio/lib_remove.c @@ -56,7 +56,7 @@ int remove(FAR const char *path) */ if (unlink(path) != 0 && /* If it is indeed a directory... */ - (get_errno() != EPERM || /* ...try to remove it. */ + (get_errno() != EISDIR || /* ...try to remove it. */ rmdir(path) != 0)) { /* Cannot remove the object for whatever reason. */