diff options
author | Aaron Merey <amerey@redhat.com> | 2022-11-04 17:22:40 -0400 |
---|---|---|
committer | Aaron Merey <amerey@redhat.com> | 2022-11-04 17:22:40 -0400 |
commit | 4628be9e03db78eaf2b02e9aa6cc677a0b4319ea (patch) | |
tree | 7ade212219d50ce33796dc8e8c4eeeb437a503d7 /debuginfod/debuginfod-client.c | |
parent | c424e5f3d24f76e01242d15ba361dc6234706fed (diff) | |
download | elfutils-4628be9e03db78eaf2b02e9aa6cc677a0b4319ea.tar.gz |
debuginfod_find_section: Always update rc with most recent error code
debuginfod_find_section may attempt to download both the debuginfo
and executable matching the given build-id. If neither of these
files can be found, update rc to ensure that we always return an
accurate error code in this case.
Signed-off-by: Aaron Merey <amerey@redhat.com>
Diffstat (limited to 'debuginfod/debuginfod-client.c')
-rw-r--r-- | debuginfod/debuginfod-client.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index f48e32cc..99da05ef 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -1944,7 +1944,8 @@ debuginfod_find_section (debuginfod_client *client, if (rc == -EEXIST) { - /* The section should be found in the executable. */ + /* Either the debuginfo couldn't be found or the section should + be in the executable. */ fd = debuginfod_find_executable (client, build_id, build_id_len, &tmp_path); if (fd > 0) @@ -1952,6 +1953,9 @@ debuginfod_find_section (debuginfod_client *client, rc = extract_section (fd, section, tmp_path, path); close (fd); } + else + /* Update rc so that we return the most recent error code. */ + rc = fd; } free (tmp_path); |