Blame SOURCES/elfutils-0.178-curl-code-gcc-10.patch

73e148
commit 374fbed3da0197f794a904e78e75e961c7e2e92c
73e148
Author: Mark Wielaard <mark@klomp.org>
73e148
Date:   Wed Dec 4 00:39:26 2019 +0100
73e148
73e148
    debuginfod: Fix implicit conversion from 'CURLcode' to 'CURLMcode'
73e148
    
73e148
    GCC10 warns when converting the value of one enum type into another:
73e148
    
73e148
    debuginfod-client.c:530:24: error: implicit conversion from ‘CURLcode’
73e148
                                       to ‘CURLMcode’ [-Werror=enum-conversion]
73e148
      530 |               curl_res = curl_easy_getinfo(target_handle,
73e148
          |                        ^
73e148
    
73e148
    libcurl has different error code enums. The "easy" interfaces return
73e148
    a CURLcode error. The "multi" interface functions return a CURLMcode.
73e148
    
73e148
    Signed-off-by: Mark Wielaard <mark@klomp.org>
73e148
73e148
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
73e148
index 6e62b86c..302ea2dc 100644
73e148
--- a/debuginfod/debuginfod-client.c
73e148
+++ b/debuginfod/debuginfod-client.c
73e148
@@ -509,8 +509,6 @@ debuginfod_query_server (debuginfod_client *c,
73e148
   long loops = 0;
73e148
   do
73e148
     {
73e148
-      CURLMcode curl_res;
73e148
-
73e148
       if (c->progressfn) /* inform/check progress callback */
73e148
         {
73e148
           loops ++;
73e148
@@ -518,6 +516,7 @@ debuginfod_query_server (debuginfod_client *c,
73e148
           long pb = 0;
73e148
           if (target_handle) /* we've committed to a server; report its download progress */
73e148
             {
73e148
+              CURLcode curl_res;
73e148
 #ifdef CURLINFO_SIZE_DOWNLOAD_T
73e148
               curl_off_t dl;
73e148
               curl_res = curl_easy_getinfo(target_handle,
73e148
@@ -564,10 +563,10 @@ debuginfod_query_server (debuginfod_client *c,
73e148
           if (data[i].handle != target_handle)
73e148
             curl_multi_remove_handle(curlm, data[i].handle);
73e148
 
73e148
-      curl_res = curl_multi_perform(curlm, &still_running);
73e148
-      if (curl_res != CURLM_OK)
73e148
+      CURLMcode curlm_res = curl_multi_perform(curlm, &still_running);
73e148
+      if (curlm_res != CURLM_OK)
73e148
         {
73e148
-          switch (curl_res)
73e148
+          switch (curlm_res)
73e148
             {
73e148
             case CURLM_CALL_MULTI_PERFORM: continue;
73e148
             case CURLM_OUT_OF_MEMORY: rc = -ENOMEM; break;