diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-10-01 11:37:01 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-10-01 11:37:01 +0300 |
commit | b746dbc136576f3b748f5d709f5eb625896b8439 (patch) | |
tree | 8458f3d7305e8b5116fa39da216ad89c941257fa /lib | |
parent | aa2117b94efe60769bde94a9e250644aa016fd99 (diff) | |
download | librpm-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |