Return negative error code from opkg_download(), not curl error codes.
[oweals/opkg-lede.git] / libopkg / opkg_download.c
index 080326cae4a153a0da6efef11c10f4399b0ace2f..cfbf35119311a800a4484b00860ec246527ac3ac 100644 (file)
@@ -144,7 +144,7 @@ opkg_download(const char *src, const char *dest_file_name,
            opkg_msg(ERROR, "Failed to download %s: %s.\n",
                    src, curl_easy_strerror(res));
            free(tmp_file_location);
-           return res;
+           return -1;
        }
 
     }
@@ -174,7 +174,7 @@ opkg_download(const char *src, const char *dest_file_name,
       if (res) {
        opkg_msg(ERROR, "Failed to download %s, wget returned %d.\n", src, res);
        free(tmp_file_location);
-       return res;
+       return -1;
       }
     }
 #endif