summaryrefslogtreecommitdiff
path: root/nuttx/binfmt/libelf/libelf_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/binfmt/libelf/libelf_init.c')
-rw-r--r--nuttx/binfmt/libelf/libelf_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nuttx/binfmt/libelf/libelf_init.c b/nuttx/binfmt/libelf/libelf_init.c
index b024f2d19..cf62666b9 100644
--- a/nuttx/binfmt/libelf/libelf_init.c
+++ b/nuttx/binfmt/libelf/libelf_init.c
@@ -107,8 +107,9 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
loadinfo->filfd = open(filename, O_RDONLY);
if (loadinfo->filfd < 0)
{
- bdbg("Failed to open ELF binary %s: %d\n", filename, ret);
- return -errno;
+ int errval = errno;
+ bdbg("Failed to open ELF binary %s: %d\n", filename, errval);
+ return -errval;
}
/* Read the ELF ehdr from offset 0 */