summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2022-11-07 11:26:32 -0500
committerFrank Ch. Eigler <fche@redhat.com>2023-04-07 11:25:58 -0400
commit0904596dd48683c95c02db54a42aff17acf173cb (patch)
tree53f98516c8dae00e541da064875a749c1d758e90
parent09af4e719149654a00253a052cc2ce53eb9ef244 (diff)
downloadelfutils-0904596dd48683c95c02db54a42aff17acf173cb.tar.gz
debuginfod-client.c: Don't treat 0 as an error code.
Replace 'fd > 0' with 'fd >= 0' to avoid treating a possible file descriptor as an error code. Signed-off-by: Aaron Merey <amerey@redhat.com>
-rw-r--r--debuginfod/ChangeLog5
-rw-r--r--debuginfod/debuginfod-client.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 4a84b87e..7289c449 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2022-11-07 Aaron Merey <amerey@redhat.com>
+
+ * debuginfod-client.c (debuginfod_find_section): Don't treat 0 as an
+ error code.
+
2022-11-04 Aaron Merey <amerey@redhat.com>
* debuginfod-client.c (debuginfod_find_section): Ensure rc
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index cc8c0d9a..510fe4bf 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -2062,7 +2062,7 @@ debuginfod_find_section (debuginfod_client *client,
}
return -ENOENT;
}
- if (fd > 0)
+ if (fd >= 0)
{
rc = extract_section (fd, section, tmp_path, path);
close (fd);
@@ -2074,7 +2074,7 @@ debuginfod_find_section (debuginfod_client *client,
be in the executable. */
fd = debuginfod_find_executable (client, build_id,
build_id_len, &tmp_path);
- if (fd > 0)
+ if (fd >= 0)
{
rc = extract_section (fd, section, tmp_path, path);
close (fd);