aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-28 01:38:17 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-28 01:38:17 +0000
commit4e1608de70d97a46640423e7504f014f52891a40 (patch)
tree8209acddf4f022320c7fdfaf646e87e995138b98
parent51b3df50dd8a761374841bfc91c226e35f64f3c9 (diff)
downloadperl-URPM-4e1608de70d97a46640423e7504f014f52891a40.tar
perl-URPM-4e1608de70d97a46640423e7504f014f52891a40.tar.gz
perl-URPM-4e1608de70d97a46640423e7504f014f52891a40.tar.bz2
perl-URPM-4e1608de70d97a46640423e7504f014f52891a40.tar.xz
perl-URPM-4e1608de70d97a46640423e7504f014f52891a40.zip
add wrapper function for headerRead
-rw-r--r--rpm5compat.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/rpm5compat.h b/rpm5compat.h
index f89d721..9e1ed8e 100644
--- a/rpm5compat.h
+++ b/rpm5compat.h
@@ -95,9 +95,8 @@ static HeaderIterator headerInitIterator(Header h){
static int headerWrite(void * _fd, Header h, enum hMagic magicp) {
const char item[] = "Header";
- Header nh = NULL;
const char * msg = NULL;
- rpmRC rc = rpmpkgWrite(item, _fd, nh, &msg);
+ rpmRC rc = rpmpkgWrite(item, _fd, h, &msg);
if (rc != RPMRC_OK) {
/* rpmlog(RPMLOG_ERR, "%s: %s: %s\n", sigtarget, item,
(msg && *msg ? msg : "write failed\n"));*/
@@ -109,3 +108,15 @@ static int headerWrite(void * _fd, Header h, enum hMagic magicp) {
return rc;
}
+static int headerRead(void * _fd, enum hMagic magicp) {
+ const char item[] = "Header";
+ Header nh = NULL;
+ const char * msg = NULL;
+ rpmRC rc = rpmpkgRead(item, _fd, nh, &msg);
+ if (rc != RPMRC_OK) {
+ msg = _free(msg);
+ rc = RPMRC_FAIL;
+ }
+ msg = _free(msg);
+ return rc;
+}