summaryrefslogtreecommitdiff
path: root/src/io_url.c
diff options
context:
space:
mode:
authorthibault.ferrante <thibault.ferrante@gmail.com>2021-01-07 17:21:36 +0100
committerTimo Teräs <timo.teras@iki.fi>2021-01-11 11:26:49 +0200
commit0fb0d304774630d53867fa3563dfd39246cc67b7 (patch)
treeb65d3ee173f4f7eab613c99487494d476a30965b /src/io_url.c
parentb58d79e78f704233f7c412343b25f20c8fb5257c (diff)
downloadapk-tools-0fb0d304774630d53867fa3563dfd39246cc67b7.tar.gz
apk-tools-0fb0d304774630d53867fa3563dfd39246cc67b7.tar.bz2
apk-tools-0fb0d304774630d53867fa3563dfd39246cc67b7.tar.xz
apk-tools-0fb0d304774630d53867fa3563dfd39246cc67b7.zip
database: Propagate errors when loading an APKINDEX
In case of failure when loading an APKINDEX, no errors are propagated to the user which may uncorrectly interpret the current problem.
Diffstat (limited to 'src/io_url.c')
-rw-r--r--src/io_url.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/io_url.c b/src/io_url.c
index d61dd52..07147c2 100644
--- a/src/io_url.c
+++ b/src/io_url.c
@@ -85,12 +85,14 @@ static ssize_t fetch_read(struct apk_istream *is, void *ptr, size_t size)
return r;
}
-static void fetch_close(struct apk_istream *is)
+static int fetch_close(struct apk_istream *is)
{
+ int r = is->err;
struct apk_fetch_istream *fis = container_of(is, struct apk_fetch_istream, is);
fetchIO_close(fis->fetchIO);
free(fis);
+ return r < 0 ? r : 0;
}
static const struct apk_istream_ops fetch_istream_ops = {