summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-10-01 11:37:01 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-01 11:37:01 +0300
commitb746dbc136576f3b748f5d709f5eb625896b8439 (patch)
tree8458f3d7305e8b5116fa39da216ad89c941257fa /lib
parentaa2117b94efe60769bde94a9e250644aa016fd99 (diff)
downloadlibrpm-tizen-b746dbc136576f3b748f5d709f5eb625896b8439.tar.gz
librpm-tizen-b746dbc136576f3b748f5d709f5eb625896b8439.tar.bz2
librpm-tizen-b746dbc136576f3b748f5d709f5eb625896b8439.zip
Avoid using/modifying fsm->li on hard link checking
- Using a "global" variable for local iteration is just dumb...
Diffstat (limited to 'lib')
-rw-r--r--lib/fsm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 676ebbbd7..4d1db7fdc 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -553,10 +553,10 @@ static int checkHardLinks(FSM_t fsm)
int rc = 0;
rpmfs fs = fsmGetFs(fsm);
- for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) {
- if (fsm->li->linksLeft) {
- for (nlink_t i = 0 ; i < fsm->li->linksLeft; i++) {
- int ix = fsm->li->filex[i];
+ for (hardLink_t li = fsm->links; li != NULL; li = li->next) {
+ if (li->linksLeft) {
+ for (nlink_t i = 0 ; i < li->linksLeft; i++) {
+ int ix = li->filex[i];
if (ix < 0 || XFA_SKIPPING(rpmfsGetAction(fs, ix)))
continue;
rc = CPIOERR_MISSING_HARDLINK;