summaryrefslogtreecommitdiff
path: root/lib/fsm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-04-17 13:28:55 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-04-17 13:28:55 +0300
commit4ef540d25bab77b46cbf4467c8f6bc22cdd0e419 (patch)
tree6715705d1c508c9a91749c87522b3257145d9787 /lib/fsm.c
parentfb51698e0c21ddd289ccbe97330aea0727da8751 (diff)
downloadlibrpm-tizen-4ef540d25bab77b46cbf4467c8f6bc22cdd0e419.tar.gz
librpm-tizen-4ef540d25bab77b46cbf4467c8f6bc22cdd0e419.tar.bz2
librpm-tizen-4ef540d25bab77b46cbf4467c8f6bc22cdd0e419.zip
Remove now unnecessary psm member from fsm struct
- Except for expandRegular(), all notification occurs from the three main worker functions. Pass as an argument for the lone special case, the other noticy already have the psm as their own argument.
Diffstat (limited to 'lib/fsm.c')
-rw-r--r--lib/fsm.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 151d68efd..653f92f8f 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -123,8 +123,6 @@ struct fsm_s {
fileStage goal; /*!< Package state machine goal. */
struct stat sb; /*!< Current file stat(2) info. */
struct stat osb; /*!< Original file stat(2) info. */
-
- rpmpsm psm; /*!< "parent" package state machine */
};
@@ -651,7 +649,6 @@ static int fsmSetup(FSM_t fsm, fileStage goal,
fsm->cfd = fdLink(cfd);
}
fsm->iter = mapInitIterator(ts, te, fi);
- fsm->psm = psm;
fsm->sehandle = rpmtsSELabelHandle(ts);
fsm->mapFlags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
@@ -843,7 +840,7 @@ static int fsmMapAttrs(FSM_t fsm)
* @param fsm file state machine data
* @return 0 on success
*/
-static int expandRegular(FSM_t fsm)
+static int expandRegular(FSM_t fsm, rpmpsm psm)
{
FD_t wfd = NULL;
const struct stat * st = &fsm->sb;
@@ -883,7 +880,7 @@ static int expandRegular(FSM_t fsm)
/* don't call this with fileSize == fileComplete */
if (!rc && left)
- rpmpsmNotify(fsm->psm, RPMCALLBACK_INST_PROGRESS, rpmcpioTell(fsm->archive));
+ rpmpsmNotify(psm, RPMCALLBACK_INST_PROGRESS, rpmcpioTell(fsm->archive));
}
if (st->st_size > 0 && fidigest) {
@@ -1847,7 +1844,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfi fi, FD_t cfd,
fsm->path = path;
if (!(rc == CPIOERR_ENOENT)) return rc;
- rc = expandRegular(fsm);
+ rc = expandRegular(fsm, psm);
} else if (S_ISDIR(st->st_mode)) {
rc = fsmVerify(fsm);
if (rc == CPIOERR_ENOENT) {
@@ -1914,7 +1911,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfi fi, FD_t cfd,
}
/* Notify on success. */
- rpmpsmNotify(fsm->psm, RPMCALLBACK_INST_PROGRESS, rpmcpioTell(fsm->archive));
+ rpmpsmNotify(psm, RPMCALLBACK_INST_PROGRESS, rpmcpioTell(fsm->archive));
if (!fsm->postpone) {
rc = ((S_ISREG(st->st_mode) && st->st_nlink > 1)
@@ -1999,7 +1996,7 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfi fi,
/* On erase we're iterating backwards, fixup for progress */
rpm_loff_t amount = (fsm->ix >= 0) ?
rpmfiFC(fsmGetFi(fsm)) - fsm->ix : 0;
- rpmpsmNotify(fsm->psm, RPMCALLBACK_UNINST_PROGRESS, amount);
+ rpmpsmNotify(psm, RPMCALLBACK_UNINST_PROGRESS, amount);
}
ec = fsmTeardown(fsm);