Ensure installs always use a temp suffix on files
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 13 Jan 2012 08:06:09 +0000 (10:06 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 13 Jan 2012 08:06:09 +0000 (10:06 +0200)
- This bogosity goes back to commit fcf6b50378eaeac4c1f7ca215b33586b4d41072f
  which was supposed to fix files getting erased if time() returns
  errors (RhBug:223931). Problem is, this "fix" didn't fix anything
  at all as the suffix still wouldn't be created in the error
  case, even if the FSM_UNDO part did the right thing. We always
  want a suffix on installs, it doesn't matter *what* the suffix is.

lib/fsm.c

index 6d84573..1710bb4 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -619,8 +619,7 @@ static int fsmSetup(FSM_t fsm, fileStage goal,
 
     memset(fsm->sufbuf, 0, sizeof(fsm->sufbuf));
     if (fsm->goal == FSM_PKGINSTALL) {
-       if (ts && rpmtsGetTid(ts) != (rpm_tid_t)-1)
-           sprintf(fsm->sufbuf, ";%08x", (unsigned)rpmtsGetTid(ts));
+       sprintf(fsm->sufbuf, ";%08x", (unsigned)rpmtsGetTid(ts));
     }
 
     ec = fsm->rc = 0;