diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-08-23 15:05:16 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-08-23 17:02:50 +0300 |
commit | 72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61 (patch) | |
tree | f0a16e94666c01a1b87bbe1b4ddbf94c90fae291 /src/app_fetch.c | |
parent | 91085a48742611182f08b0c83621641261bca850 (diff) | |
download | apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.gz apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.bz2 apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.tar.xz apk-tools-72d8cb8937c5ffa7016ef3fdfeb17c5abae97b61.zip |
remove IS_ERR_OR_NULL
In most places where pointer can be an 'error' it cannot be null
pointer. Further, in those cases just calling PTR_ERR() is not enough
to handle the null case. Simplify code by removing this case.
If NULL case needs to be handled, it's better to add separate check
and return fixed error code in that case.
Diffstat (limited to 'src/app_fetch.c')
-rw-r--r-- | src/app_fetch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/app_fetch.c b/src/app_fetch.c index c54a8e0..556ec49 100644 --- a/src/app_fetch.c +++ b/src/app_fetch.c @@ -171,8 +171,8 @@ static int fetch_package(apk_hash_item item, void *pctx) } is = apk_istream_from_fd_url(urlfd, url, apk_db_url_since(db, 0)); - if (IS_ERR_OR_NULL(is)) { - r = PTR_ERR(is) ?: -EIO; + if (IS_ERR(is)) { + r = PTR_ERR(is); goto err; } @@ -219,7 +219,7 @@ static void mark_name_flags(struct apk_database *db, const char *match, struct a .result_mask = APK_DEPMASK_ANY, }; - if (!IS_ERR_OR_NULL(name)) { + if (name) { name->auto_select_virtual = 1; apk_deps_add(&ctx->world, &dep); } else { |