From: Panu Matilainen Date: Tue, 17 Apr 2012 07:49:26 +0000 (+0300) Subject: Minimally fix file/directory removal X-Git-Tag: rpm-4.11.0-alpha~418 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4d25c7ab25e0e5ae935a4ac0edf918c38a67eaa;p=platform%2Fupstream%2Frpm.git Minimally fix file/directory removal - In their previous life these breaks applied to a switch-case but now they end up aborting the loop on first successful removal, causing everything but the first file/directory of a package to be left behind on erase. Fixes the previously unnoticed regression from commit 1845c1d711b88723e596c88e8a7730a360029089. --- diff --git a/lib/fsm.c b/lib/fsm.c index 6934858..d18bff0 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -1963,7 +1963,7 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfi fi, rpmte te = fsmGetTe(fsm); if (S_ISDIR(fsm->sb.st_mode)) { rc = fsmRmdir(fsm->path); - if (!rc) break; + if (!rc) continue; switch (rc) { case CPIOERR_ENOENT: /* XXX rmdir("/") linux 2.2.x kernel hack */ case CPIOERR_ENOTEMPTY: @@ -1986,7 +1986,7 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfi fi, } } else { rc = fsmUnlink(fsm->path, fsm->mapFlags); - if (!rc) break; + if (!rc) continue; switch (rc) { case CPIOERR_ENOENT: if (fsm->fflags & RPMFILE_MISSINGOK)