summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-06-19 16:09:30 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-06-19 16:10:13 +0300
commitd89c219173aeaea174deb8dd7477e1ea7ea71510 (patch)
tree0aaac0c4735e2f3e27205b7e8a717a157518428b /src/io.c
parent17684141fe9d895361262b10c4c229fbcff6e702 (diff)
downloadapk-tools-d89c219173aeaea174deb8dd7477e1ea7ea71510.tar.gz
apk-tools-d89c219173aeaea174deb8dd7477e1ea7ea71510.tar.bz2
apk-tools-d89c219173aeaea174deb8dd7477e1ea7ea71510.tar.xz
apk-tools-d89c219173aeaea174deb8dd7477e1ea7ea71510.zip
reduce misuse of error codes from errno.h
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/io.c b/src/io.c
index 2c42eb1..43dfa5a 100644
--- a/src/io.c
+++ b/src/io.c
@@ -127,7 +127,7 @@ void *apk_istream_get(struct apk_istream *is, size_t len)
if (is->end-is->ptr == is->buf_size)
return ERR_PTR(-ENOBUFS);
if (is->err > 0)
- return ERR_PTR(-ENOMSG);
+ return ERR_PTR(-APKE_EOF);
return ERR_PTR(-EIO);
}
@@ -498,7 +498,7 @@ ssize_t apk_stream_copy(struct apk_istream *is, struct apk_ostream *os, size_t s
d = apk_istream_get_max(is, size - done);
if (APK_BLOB_IS_NULL(d)) {
if (d.len) return d.len;
- if (size != APK_IO_ALL) return -EBADMSG;
+ if (size != APK_IO_ALL) return -APKE_EOF;
break;
}
if (dctx) apk_digest_ctx_update(dctx, d.ptr, d.len);
@@ -547,7 +547,7 @@ ssize_t apk_istream_splice(struct apk_istream *is, int fd, size_t size,
if (r <= 0) {
if (r) goto err;
if (size != APK_IO_ALL && done != size) {
- r = -EBADMSG;
+ r = -APKE_EOF;
goto err;
}
break;