libdwfl: Fix Linux kernel module search when dwfl_build_id_find_elf closes fd on...
authorRoland McGrath <roland@redhat.com>
Wed, 30 Jun 2010 07:45:58 +0000 (00:45 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 30 Jun 2010 07:45:58 +0000 (00:45 -0700)
libdwfl/ChangeLog
libdwfl/linux-kernel-modules.c

index ff850eb..5620e23 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-30  Roland McGrath  <roland@redhat.com>
+
+       * 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  <roland@redhat.com>
 
        * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
index c30ff1a..2479292 100644 (file)
@@ -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;
     }