Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/37479 )
Change subject: curl: Handle errors in curl_easy_perform() ......................................................................
curl: Handle errors in curl_easy_perform()
Not much we can do, but at least warn the user that something went wrong.
Change-Id: I96374d1b153113a302fa98c27873db863a22f77e Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Reviewed-on: https://review.coreboot.org/c/em100/+/37479 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M curl.c 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/curl.c b/curl.c index 747a98d..d13dfe8 100644 --- a/curl.c +++ b/curl.c @@ -110,6 +110,9 @@
/* Fetch the file */ res = curl_easy_perform(curl); + if (res != CURLE_OK) + printf("Error while downloading %s: %s\n", filename, + curl_easy_strerror(res));
/* Close file */ fclose(file); @@ -117,7 +120,7 @@ /* Clean up */ curl_easy_cleanup(curl);
- return 0; + return (res == CURLE_OK) ? 0 : -1; }
void download(const char *name, const char *id)