From 81cfccae4f4298f812eae4eb3dc859220ca8a21e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 30 Jun 2010 00:45:58 -0700 Subject: [PATCH] libdwfl: Fix Linux kernel module search when dwfl_build_id_find_elf closes fd on success. --- libdwfl/ChangeLog | 6 ++++++ libdwfl/linux-kernel-modules.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index ff850ebff..5620e23c4 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,9 @@ +2010-06-30 Roland McGrath + + * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be + confused by -1 return from dwfl_build_id_find_elf after it opened + the Elf handle. + 2010-06-16 Roland McGrath * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro. diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index c30ff1a3a..2479292ac 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -627,7 +627,7 @@ dwfl_linux_kernel_find_elf (Dwfl_Module *mod, { int fd = INTUSE(dwfl_build_id_find_elf) (mod, NULL, NULL, 0, file_name, elfp); - if (fd >= 0 || errno != 0) + if (fd >= 0 || mod->main.elf != NULL || errno != 0) return fd; } -- 2.47.2