]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod-client.c: Don't treat 0 as an error code.
authorAaron Merey <amerey@redhat.com>
Mon, 7 Nov 2022 16:26:32 +0000 (11:26 -0500)
committerAaron Merey <amerey@redhat.com>
Mon, 7 Nov 2022 16:26:32 +0000 (11:26 -0500)
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>
debuginfod/ChangeLog
debuginfod/debuginfod-client.c

index 5678002ab2d9fd916d0743a9215a1fe8b63bea28..a17bc5ab7add9d77271eb365294f7262c8ff8606 100644 (file)
@@ -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
index 99da05ef04830a8715ea6fec0fd76230c0cbf412..f9f26fd5880c597aa5c0f54a77f0d6fccf35dce2 100644 (file)
@@ -1936,7 +1936,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);
@@ -1948,7 +1948,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);