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