summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-09-26 09:52:55 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-09-26 09:52:55 +0300
commit0ddf824afb647b620400dba8172fa4ca7ee1690b (patch)
tree76a6512f230e1d83be7539d39145ac2d33c5d5ae
parentd16bdb1550c3c3c13a40ad9cb6869564a6abbc38 (diff)
downloadrpm-0ddf824afb647b620400dba8172fa4ca7ee1690b.tar.gz
rpm-0ddf824afb647b620400dba8172fa4ca7ee1690b.tar.bz2
rpm-0ddf824afb647b620400dba8172fa4ca7ee1690b.zip
Eliminate some unnecessary rpmte-internal accesses in psm
-rw-r--r--lib/psm.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 18270655c..2a2b801f9 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -270,7 +270,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
goto exit;
}
- fi->te->h = headerLink(fi->h);
+ rpmteSetHeader(fi->te, fi->h);
fi->te->fd = fdLink(fd, "installSourcePackage");
hge = fi->hge;
hfd = fi->hfd;
@@ -386,7 +386,7 @@ exit:
if (h != NULL) h = headerFree(h);
if (fi != NULL) {
- fi->te->h = headerFree(fi->te->h);
+ rpmteSetHeader(fi->te, NULL);
if (fi->te->fd != NULL)
(void) Fclose(fi->te->fd);
fi->te->fd = NULL;
@@ -1377,9 +1377,8 @@ assert(psm->mi == NULL);
/* Retrieve installed header. */
rc = rpmpsmNext(psm, PSM_RPMDB_LOAD);
-if (rc == RPMRC_OK)
-if (psm->te)
-psm->te->h = headerLink(fi->h);
+ if (rc == RPMRC_OK && psm->te)
+ rpmteSetHeader(psm->te, fi->h);
}
if (psm->goal == PSM_PKGSAVE) {
/* Open output package for writing. */
@@ -1815,9 +1814,8 @@ psm->te->h = headerLink(fi->h);
}
if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) {
-if (psm->te != NULL)
-if (psm->te->h != NULL)
-psm->te->h = headerFree(psm->te->h);
+ if (psm->te != NULL)
+ rpmteSetHeader(psm->te, NULL);
if (fi->h != NULL)
fi->h = headerFree(fi->h);
}