summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormorganamilo <morganamilo@gmail.com>2019-06-11 18:43:26 +0200
committerAllan McRae <allan@archlinux.org>2019-06-28 05:39:48 +0200
commit0e67ee55bd0f41ed8f62cc574c03ee27625be317 (patch)
treee73fb0342a0cf0cbedc7ab897e891315d25a442d
parent796c02af4c39b6f90f955d4764676711357c5db0 (diff)
downloadpacman-0e67ee55bd0f41ed8f62cc574c03ee27625be317.tar.gz
pacman-0e67ee55bd0f41ed8f62cc574c03ee27625be317.tar.xz
Correctly report a download failiure for 404s
Currently when caling alpm_trans_commit, if fetching a package restults in a 404 (or other non 400 response code), the function returns -1 but errno is never set. This patch sets errno to ALPM_ERR_RETRIEVE. Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/dload.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 05813c40..e5696bb0 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -454,6 +454,7 @@ static int curl_download_internal(struct dload_payload *payload,
if(payload->respcode >= 400) {
payload->unlink_on_fail = 1;
if(!payload->errors_ok) {
+ handle->pm_errno = ALPM_ERR_RETRIEVE;
/* non-translated message is same as libcurl */
snprintf(error_buffer, sizeof(error_buffer),
"The requested URL returned error: %ld", payload->respcode);