summaryrefslogtreecommitdiff
path: root/ccache.c
diff options
context:
space:
mode:
Diffstat (limited to 'ccache.c')
-rw-r--r--ccache.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ccache.c b/ccache.c
index 92b786fc..25bf4797 100644
--- a/ccache.c
+++ b/ccache.c
@@ -313,7 +313,8 @@ get_remote_file(const char *name, const char *suffix, const char *path)
}
res = curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1l);
if (res != CURLE_OK) {
- cc_log("Curl could not set FAILONERROR: %u", res);
+ cc_log("Curl could not set FAILONERROR: %s",
+ curl_easy_strerror(res));
return res;
}
}
@@ -326,7 +327,8 @@ get_remote_file(const char *name, const char *suffix, const char *path)
}
/* tell curl to download from this url */
if ((res = curl_easy_setopt(curl, CURLOPT_URL, url)) != CURLE_OK) {
- cc_log("Curl failed to set url to %s: %u", url, res);
+ cc_log("Curl failed to set url to %s: %s",
+ url, curl_easy_strerror(res));
goto cleanup;
}
@@ -352,15 +354,15 @@ get_remote_file(const char *name, const char *suffix, const char *path)
/* tell curl to write to that file */
res = curl_easy_setopt(curl, CURLOPT_WRITEDATA, dest);
if (res != CURLE_OK) {
- cc_log("Curl could not set output file to %s: %u",
- tempfilename, res);
+ cc_log("Curl could not set output file to %s: %s",
+ tempfilename, curl_easy_strerror(res));
goto cleanup_rm;
}
/* do the download */
if ((res = curl_easy_perform(curl)) != CURLE_OK) {
- cc_log("Curl could not download %s to %s: %u",
- url, tempfilename, res);
+ cc_log("Curl could not download %s to %s: %s",
+ url, tempfilename, curl_easy_strerror(res));
goto cleanup_rm;
}
@@ -384,7 +386,7 @@ get_remote_file(const char *name, const char *suffix, const char *path)
stats_update(STATS_DOWNLOADED);
cleanup_rm:
- x_unlink(tempfilename);
+ tmp_unlink(tempfilename);
cleanup:
if (dest) fclose(dest);
free(tempfilename);