summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2015-08-12 03:12:27 +0200
committerpark <sk7.park@samsung.com>2017-01-02 02:36:48 -0800
commitcae7c0feb50a85e859b5899aa12b86ac88f22533 (patch)
tree82503a622bf636d0298be5428b3118d2a49996bb
parent56bc11d6146937eac049fb5b9b7d64b96357e075 (diff)
downloadrpm-cae7c0feb50a85e859b5899aa12b86ac88f22533.tar.gz
rpm-cae7c0feb50a85e859b5899aa12b86ac88f22533.tar.bz2
rpm-cae7c0feb50a85e859b5899aa12b86ac88f22533.zip
add rpmlog(RPMLOG_ERR, ...) for liblzma return codes
Change-Id: I25c017827b38e2141dcff4d6bfd398f9e1a008c2
-rw-r--r--rpmio/rpmio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 2d35c1279..60da8bea1 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -934,6 +934,19 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x
ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0);
}
if (ret != LZMA_OK) {
+ switch (ret) {
+ case LZMA_MEM_ERROR:
+ rpmlog(RPMLOG_ERR, "liblzma: Memory allocation failed");
+ break;
+
+ case LZMA_DATA_ERROR:
+ rpmlog(RPMLOG_ERR, "liblzma: File size limits exceeded");
+ break;
+
+ default:
+ rpmlog(RPMLOG_ERR, "liblzma: <Unknown error (%d), possibly a bug", ret);
+ break;
+ }
fclose(fp);
free(lzfile);
return 0;