Return negative error code from opkg_download(), not curl error codes.
[oweals/opkg-lede.git] / libopkg / opkg_download.c
index fc97d34d8ebbe889de92024a6bd87b46ce1fd03f..cfbf35119311a800a4484b00860ec246527ac3ac 100644 (file)
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.
 */
+
 #include "config.h"
 
-#include "includes.h"
+#include <stdio.h>
+#include <unistd.h>
+
 #include "opkg_download.h"
 #include "opkg_message.h"
 
@@ -141,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;
        }
 
     }
@@ -171,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