From 6ba250e4001740ca428226abf157b25aa121c7bf Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 13 Apr 2020 22:24:23 +1000 Subject: 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 --- lib/libalpm/dload.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/dload.c') 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) { -- cgit v1.2.3-54-g00ecf