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

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