]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod-client: Ensure only negative error codes returned.
authorAaron Merey <amerey@redhat.com>
Wed, 28 Sep 2022 14:04:23 +0000 (10:04 -0400)
committerAaron Merey <amerey@redhat.com>
Wed, 28 Sep 2022 14:16:04 +0000 (10:16 -0400)
Switch a couple error codes from positive to negative so they aren't
interpreted as file descriptors by the caller.

debuginfod/ChangeLog
debuginfod/debuginfod-client.c

index 680720ff87e8a83e8e04717f4cd296418710d0fb..8fb65133f3e1095700b99c2d2bbcd6dc77894211 100644 (file)
@@ -1,3 +1,8 @@
+2022-09-28  Aaron Merey  <amerey@redhat.com>
+
+       * debuginfod-client.c (debuginfod_query_server): Switch sign of some
+       error codes from positive to negative.
+
 2022-09-08  Frank Ch. Eigler  <fche@redhat.com>
 
        * debuginfod-client.c (debuginfod_query_server): Clear
index 28ad04c06dfe29f68f244769de8c17fd7775ad3f..2a14d9d96d2bb96c7078c0e9fcfa8f4d75203328 100644 (file)
@@ -1085,7 +1085,7 @@ debuginfod_query_server (debuginfod_client *c,
   c->winning_headers = NULL;
   if ( maxtime > 0 && clock_gettime(CLOCK_MONOTONIC_RAW, &start_time) == -1)
     {
-      rc = errno;
+      rc = -errno;
       goto out2;
     }
   long delta = 0;
@@ -1096,7 +1096,7 @@ debuginfod_query_server (debuginfod_client *c,
         {
           if (clock_gettime(CLOCK_MONOTONIC_RAW, &cur_time) == -1)
             {
-              rc = errno;
+              rc = -errno;
               goto out2;
             }
           delta = cur_time.tv_sec - start_time.tv_sec;