aboutsummaryrefslogtreecommitdiffstats
path: root/rpm5compat.h
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-29 19:06:20 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-29 19:06:20 +0000
commit9c4aaad7df7284d0a752400e1a27012513832f85 (patch)
tree0e4f1e89526a9346ca6f8eb61c50ba0f2d7cfa5e /rpm5compat.h
parentf553bf689ac0f5f8d18dd7e43c8051b1963eb35e (diff)
downloadperl-URPM-9c4aaad7df7284d0a752400e1a27012513832f85.tar
perl-URPM-9c4aaad7df7284d0a752400e1a27012513832f85.tar.gz
perl-URPM-9c4aaad7df7284d0a752400e1a27012513832f85.tar.bz2
perl-URPM-9c4aaad7df7284d0a752400e1a27012513832f85.tar.xz
perl-URPM-9c4aaad7df7284d0a752400e1a27012513832f85.zip
be sure to return NULL in case of RPMRC_NOTFOUND
Diffstat (limited to 'rpm5compat.h')
-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;