summaryrefslogtreecommitdiff
path: root/lib/fsm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-18 10:10:03 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-18 10:10:03 +0200
commit8bdd462b50b7930c94cd7c59ac068934f60cffcf (patch)
treefb65265a21ae96be3f062de20615c1dee951c0a8 /lib/fsm.c
parent28723cae06d49e4ba2401199da47763b1fc28ef8 (diff)
downloadrpm-8bdd462b50b7930c94cd7c59ac068934f60cffcf.tar.gz
rpm-8bdd462b50b7930c94cd7c59ac068934f60cffcf.tar.bz2
rpm-8bdd462b50b7930c94cd7c59ac068934f60cffcf.zip
Make fsm failedFile non-const like it really is
- callers need to free it so const is wrong - cast away the hardlink-hackery in fsm instead
Diffstat (limited to 'lib/fsm.c')
-rw-r--r--lib/fsm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index b9a7fe30f..275053167 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -493,7 +493,7 @@ FSM_t freeFSM(FSM_t fsm)
int fsmSetup(FSM_t fsm, fileStage goal,
const rpmts ts, const rpmfi fi, FD_t cfd,
- unsigned int * archiveSize, const char ** failedFile)
+ unsigned int * archiveSize, char ** failedFile)
{
size_t pos = 0;
int rc, ec = 0;
@@ -1844,7 +1844,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
/* Notify on success. */
if (!rc) rc = fsmNext(fsm, FSM_NOTIFY);
else if (fsm->failedFile && *fsm->failedFile == NULL) {
- *fsm->failedFile = fsm->path;
+ /* XXX ick, stripping const */
+ *fsm->failedFile = (char *) fsm->path;
fsm->path = NULL;
}
break;
@@ -1865,7 +1866,12 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
if (fsm->failedFile && *fsm->failedFile == NULL) {
fsm->ix = fsm->li->filex[i];
if (!fsmNext(fsm, FSM_MAP)) {
- *fsm->failedFile = fsm->path;
+ /*
+ * XXX ick, stripping const. Out-of-sync
+ * hardlinks handled as sub-state, see
+ * changeset 4062:02b0c237b675
+ */
+ *fsm->failedFile = (char *) fsm->path;
fsm->path = NULL;
}
}