]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: Clear errno before using its ambient value.
authorRoland McGrath <roland@redhat.com>
Wed, 9 Mar 2011 00:26:02 +0000 (16:26 -0800)
committerRoland McGrath <roland@redhat.com>
Wed, 9 Mar 2011 00:26:02 +0000 (16:26 -0800)
libdwfl/ChangeLog
libdwfl/dwfl_module_getdwarf.c

index 0cbeb85023998830f7c40e6d1cb639d2bc4c3624..3edc11bea8cd6bfc7ecc104217b8c995fa5e3a97 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-08  Roland McGrath  <roland@redhat.com>
+
+       * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
+       Reported by Kurt Roeckx <kurt@roeckx.be>.
+
 2011-02-11  Roland McGrath  <roland@redhat.com>
 
        * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
index dbb1d604fb244ab8f032390c118bd0e37aaf5ed9..9c6771311a7086b6decf07cefceaf7b611fb6994 100644 (file)
@@ -61,6 +61,10 @@ open_elf (Dwfl_Module *mod, struct dwfl_file *file)
 {
   if (file->elf == NULL)
     {
+      /* CBFAIL uses errno if it's set, so clear it first in case we don't
+        set it with an open failure below.  */
+      errno = 0;
+
       /* If there was a pre-primed file name left that the callback left
         behind, try to open that file name.  */
       if (file->fd < 0 && file->name != NULL)