Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/dload.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2020-04-13 22:24:23 +1000
committerAllan McRae <allan@archlinux.org>2020-04-13 23:44:46 +1000
commit6ba250e4001740ca428226abf157b25aa121c7bf (patch)
treeffed2284aad82174e784e01f1ded9af126880cf9 /lib/libalpm/dload.c
parent0eda92c5d4f8810a68066ee72713ffdfa878dd8c (diff)
Use GOTO_ERR throughout
The GOTO_ERR define was added in commit 80ae8014 for use in future commits. There are plenty of places in the code base it can be used, so convert them. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/dload.c')
-rw-r--r--lib/libalpm/dload.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 670da03d..57232a53 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -424,11 +424,10 @@ static int curl_download_internal(struct dload_payload *payload,
if(localf == NULL) {
localf = fopen(payload->tempfile_name, payload->tempfile_openmode);
if(localf == NULL) {
- handle->pm_errno = ALPM_ERR_RETRIEVE;
_alpm_log(handle, ALPM_LOG_ERROR,
_("could not open file %s: %s\n"),
payload->tempfile_name, strerror(errno));
- goto cleanup;
+ GOTO_ERR(handle, ALPM_ERR_RETRIEVE, cleanup);
}
}
@@ -535,10 +534,9 @@ static int curl_download_internal(struct dload_payload *payload,
* as actually being transferred during curl_easy_perform() */
if(!DOUBLE_EQ(remote_size, -1) && !DOUBLE_EQ(bytes_dl, -1) &&
!DOUBLE_EQ(bytes_dl, remote_size)) {
- handle->pm_errno = ALPM_ERR_RETRIEVE;
_alpm_log(handle, ALPM_LOG_ERROR, _("%s appears to be truncated: %jd/%jd bytes\n"),
payload->remote_name, (intmax_t)bytes_dl, (intmax_t)remote_size);
- goto cleanup;
+ GOTO_ERR(handle, ALPM_ERR_RETRIEVE, cleanup);
}
if(payload->trust_remote_name) {