From: Roland McGrath Date: Wed, 30 Jun 2010 07:45:58 +0000 (-0700) Subject: libdwfl: Fix Linux kernel module search when dwfl_build_id_find_elf closes fd on... X-Git-Tag: elfutils-0.149~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81cfccae4f4298f812eae4eb3dc859220ca8a21e;p=thirdparty%2Felfutils.git libdwfl: Fix Linux kernel module search when dwfl_build_id_find_elf closes fd on success. --- 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; }