On Mon, Mar 07, 2011 at 11:51:36PM +0100, Kurt Roeckx wrote:
/* 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)
file->fd = TEMP_FAILURE_RETRY (open64 (file->name, O_RDONLY));
if (file->fd < 0)
return CBFAIL;
[...]
But we probably shouldn't be
doing anything with errno at this time since we didn't even try
to open the file.
This patch atleast fixes it for me:
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
index dbb1d60..c475050 100644
--- a/libdwfl/dwfl_module_getdwarf.c
+++ b/libdwfl/dwfl_module_getdwarf.c
@@ -63,6 +63,7 @@ open_elf (Dwfl_Module *mod, struct dwfl_file *file)
{
/* If there was a pre-primed file name left that the callback left
behind, try to open that file name. */
+ errno = 0;
if (file->fd < 0 && file->name != NULL)
file->fd = TEMP_FAILURE_RETRY (open64 (file->name, O_RDONLY));
Kurt