summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-10-30 12:25:15 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-10-30 12:25:15 +0200
commit80ab4ab3f6f6853736f47ee7214a9fbd24f9510b (patch)
tree36996b68b331bd4a6551ffdba1d0b7f7204bffc0
parent9482ab214144679f2736598e784f9fc59e3dbf4b (diff)
downloadrpm-80ab4ab3f6f6853736f47ee7214a9fbd24f9510b.tar.gz
rpm-80ab4ab3f6f6853736f47ee7214a9fbd24f9510b.tar.bz2
rpm-80ab4ab3f6f6853736f47ee7214a9fbd24f9510b.zip
Avoid rpmte internals access in rpmtsNotify()
-rw-r--r--lib/rpmts.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c
index e794a047b..c297b42d3 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -16,7 +16,6 @@
#include "rpmlock.h"
#include "rpmerr.h"
-#define _RPMTE_INTERNAL /* XXX te->h */
#include "rpmte.h"
#define _RPMTS_INTERNAL
@@ -1418,11 +1417,13 @@ void * rpmtsNotify(rpmts ts, rpmte te,
{
void * ptr = NULL;
if (ts && ts->notify && te) {
-assert(!(te->type == TR_ADDED && te->h == NULL));
+ Header h = rpmteHeader(te);
+assert(!(rpmteType(te) == TR_ADDED && h == NULL));
/* FIX: cast? */
/* FIX: check rc */
- ptr = ts->notify(te->h, what, amount, total,
+ ptr = ts->notify(h, what, amount, total,
rpmteKey(te), ts->notifyData);
+ headerUnlink(h); /* undo rpmteHeader() ref */
}
return ptr;
}