diff options
author | Edan Bedrik <3d4nb3@gmail.com> | 2018-05-08 21:39:16 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-05-08 22:44:23 +0300 |
commit | dafbb1c4f4c1266b31eafa967c024d6f79789842 (patch) | |
tree | df7c418878c042c3a660422d382d6e397a10f9f8 /src | |
parent | 258519b1cd32e285060fa4758c123b55ebfe3ef3 (diff) | |
download | apk-tools-dafbb1c4f4c1266b31eafa967c024d6f79789842.tar.gz apk-tools-dafbb1c4f4c1266b31eafa967c024d6f79789842.tar.bz2 apk-tools-dafbb1c4f4c1266b31eafa967c024d6f79789842.tar.xz apk-tools-dafbb1c4f4c1266b31eafa967c024d6f79789842.zip |
url: return relevant error value from apk_istream_fetch
Diffstat (limited to 'src')
-rw-r--r-- | src/url.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -110,14 +110,21 @@ static const struct apk_istream_ops fetch_istream_ops = { static struct apk_istream *apk_istream_fetch(const char *url, time_t since) { - struct apk_fetch_istream *fis; + struct apk_fetch_istream *fis = NULL; struct url *u; fetchIO *io = NULL; - int rc = -ENOMEM; + int rc = -EIO; u = fetchParseURL(url); + if (!u) { + rc = -EAPKBADURL; + goto err; + } fis = malloc(sizeof(*fis)); - if (!fis || !u) goto err; + if (!fis) { + rc = -ENOMEM; + goto err; + } u->last_modified = since; io = fetchXGet(u, &fis->urlstat, (apk_force & APK_FORCE_REFRESH) ? "Ci" : "i"); |