diff options
author | Roland McGrath <roland@redhat.com> | 2011-03-08 16:26:02 -0800 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2011-03-08 16:26:02 -0800 |
commit | e07da4f30d2fabc6e2d4a4bfcc05e02091c99f0a (patch) | |
tree | 0f6cd965a374cee426ec9c717b17611ce96e4589 /libdwfl/dwfl_module_getdwarf.c | |
parent | 4894221f67d2267f9d701366f257dc2ff44a24c3 (diff) | |
download | elfutils-e07da4f30d2fabc6e2d4a4bfcc05e02091c99f0a.tar.gz |
libdwfl: Clear errno before using its ambient value.
Diffstat (limited to 'libdwfl/dwfl_module_getdwarf.c')
-rw-r--r-- | libdwfl/dwfl_module_getdwarf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c index dbb1d604..9c677131 100644 --- a/libdwfl/dwfl_module_getdwarf.c +++ b/libdwfl/dwfl_module_getdwarf.c @@ -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) |