aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-29 19:06:57 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-29 19:06:57 +0000
commit8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa (patch)
tree8f91b684f136cc302abeb772805df84955d7468d
parentc0d1848acf105888c894d7cc36bea349e327ca9a (diff)
downloadrpmtools-8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa.tar
rpmtools-8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa.tar.gz
rpmtools-8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa.tar.bz2
rpmtools-8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa.tar.xz
rpmtools-8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa.zip
be sure to set header to NULL in case of RPMRC_NOTFOUND
-rw-r--r--rpm5compat.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/rpm5compat.h b/rpm5compat.h
index e3624bd..bf2c927 100644
--- a/rpm5compat.h
+++ b/rpm5compat.h
@@ -142,9 +142,13 @@ static inline Header headerRead(void * _fd, enum hMagic magicp) {
Header h = NULL;
const char * msg = NULL;
rpmRC rc = rpmpkgRead(item, _fd, &h, &msg);
- if (rc != RPMRC_OK) {
- rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", item, msg);
- rc = RPMRC_FAIL;
+ switch (rc) {
+ default:
+ rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", item, msg);
+ case RPMRC_NOTFOUND:
+ h = NULL;
+ case RPMRC_OK:
+ break;
}
msg = _free(msg);
return h;