casaroli commented on code in PR #21902:
URL: https://github.com/apache/nuttx/pull/21902#discussion_r4645829753
##########
libs/libc/elf/elf_load.c:
##########
@@ -825,13 +824,7 @@ static int libelf_pinhold(FAR struct mod_loadinfo_s
*loadinfo)
return -ENOMEM;
}
- ret = file_get(loadinfo->filfd, &filep);
- if (ret >= 0)
- {
- ret = file_dup2(filep, loadinfo->pinfile);
- file_put(filep);
- }
-
+ ret = file_dup2(&loadinfo->file, loadinfo->pinfile);
Review Comment:
No user copy needs it: libelf_pinhold() is built only with
HAVE_LIBC_ELF_PIN, and include/nuttx/lib/elf.h sets it only in the flat build
and in the kernel. There `_NX_FILE` is always `struct file`, and the pin is
held in a `struct file` too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]