summaryrefslogtreecommitdiff
path: root/lib/fsm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-10-01 13:19:59 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-01 13:19:59 +0300
commite9054c9880642c0f4675f204105222f69d121836 (patch)
tree960650e1cc07cc00e282d8199826b202923b9697 /lib/fsm.c
parentf71af8b4a1f58d09b5abd33a2ad59d5a2f5f415c (diff)
downloadlibrpm-tizen-e9054c9880642c0f4675f204105222f69d121836.tar.gz
librpm-tizen-e9054c9880642c0f4675f204105222f69d121836.tar.bz2
librpm-tizen-e9054c9880642c0f4675f204105222f69d121836.zip
Eliminate all the now unnecessary fsm->ix save-and-restores
- Now that the relevant places are accepting file index as argument, we no longer need to save and restore fsm->ix in all the places dealing with hard links.
Diffstat (limited to 'lib/fsm.c')
-rw-r--r--lib/fsm.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index bfb7f7592..5ebf28d4d 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -562,7 +562,6 @@ static int checkHardLinks(FSM_t fsm)
continue;
rc = CPIOERR_MISSING_HARDLINK;
if (fsm->failedFile && *fsm->failedFile == NULL) {
- fsm->ix = ix;
if (!fsmMapPath(fsm, ix)) {
/* Out-of-sync hardlinks handled as sub-state */
*fsm->failedFile = fsm->path;
@@ -917,20 +916,17 @@ static int writeLinkedFile(FSM_t fsm, rpmcpio_t archive, hardLink_t li)
{
char * path = fsm->path;
const char * nsuffix = fsm->nsuffix;
- int iterIndex = fsm->ix;
int ec = 0;
int rc;
int i;
fsm->path = NULL;
fsm->nsuffix = NULL;
- fsm->ix = -1;
for (i = li->nlink - 1; i >= 0; i--) {
if (li->filex[i] < 0) continue;
- fsm->ix = li->filex[i];
rc = fsmMapPath(fsm, li->filex[i]);
/* Write data after last link. */
@@ -944,7 +940,6 @@ static int writeLinkedFile(FSM_t fsm, rpmcpio_t archive, hardLink_t li)
li->filex[i] = -1;
}
- fsm->ix = iterIndex;
fsm->nsuffix = nsuffix;
fsm->path = path;
return ec;
@@ -1011,16 +1006,13 @@ static int fsmMakeLinks(FSM_t fsm, hardLink_t li)
char * path = fsm->path;
char * opath = NULL;
const char * nsuffix = fsm->nsuffix;
- int iterIndex = fsm->ix;
int ec = 0;
int rc;
int i;
fsm->path = NULL;
fsm->nsuffix = NULL;
- fsm->ix = -1;
- fsm->ix = li->filex[li->createdPath];
rc = fsmMapPath(fsm, li->filex[li->createdPath]);
opath = fsm->path;
fsm->path = NULL;
@@ -1028,7 +1020,6 @@ static int fsmMakeLinks(FSM_t fsm, hardLink_t li)
if (li->filex[i] < 0) continue;
if (li->createdPath == i) continue;
- fsm->ix = li->filex[i];
fsm->path = _free(fsm->path);
rc = fsmMapPath(fsm, li->filex[i]);
if (XFA_SKIPPING(fsm->action)) continue;
@@ -1054,7 +1045,6 @@ static int fsmMakeLinks(FSM_t fsm, hardLink_t li)
fsm->path = _free(fsm->path);
free(opath);
- fsm->ix = iterIndex;
fsm->nsuffix = nsuffix;
fsm->path = path;
return ec;
@@ -1071,7 +1061,6 @@ static int fsmCommitLinks(FSM_t fsm)
{
char * path = fsm->path;
const char * nsuffix = fsm->nsuffix;
- int iterIndex = fsm->ix;
struct stat * st = &fsm->sb;
int rc = 0;
nlink_t i;
@@ -1079,7 +1068,6 @@ static int fsmCommitLinks(FSM_t fsm)
fsm->path = NULL;
fsm->nsuffix = NULL;
- fsm->ix = -1;
for (li = fsm->links; li != NULL; li = li->next) {
if (li->sb.st_ino == st->st_ino && li->sb.st_dev == st->st_dev)
@@ -1088,7 +1076,6 @@ static int fsmCommitLinks(FSM_t fsm)
for (i = 0; i < li->nlink; i++) {
if (li->filex[i] < 0) continue;
- fsm->ix = li->filex[i];
rc = fsmMapPath(fsm, li->filex[i]);
if (!XFA_SKIPPING(fsm->action))
rc = fsmCommit(fsm, li->filex[i]);
@@ -1096,7 +1083,6 @@ static int fsmCommitLinks(FSM_t fsm)
li->filex[i] = -1;
}
- fsm->ix = iterIndex;
fsm->nsuffix = nsuffix;
fsm->path = path;
return rc;