add rpmlog(RPMLOG_ERR, ...) for liblzma return codes

This commit is contained in:
Per Øyvind Karlsen 2015-08-12 03:12:27 +02:00 committed by Vitaly Chikunov
parent 459b3bc3f8
commit c254b0d63f

View File

@ -2831,6 +2831,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 NULL;