Use rpmtsNotify() directly for psm error callbacks
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 4 Jan 2012 09:31:00 +0000 (11:31 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 5 Jan 2012 14:05:10 +0000 (16:05 +0200)
- On error we're already on our way out of the psm, no point mucking
  with the psm state. No functional changes, just makes the code
  a little bit shorter.

lib/psm.c

index 6ccb9a7..c23816a 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -837,11 +837,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
                rc = RPMRC_FAIL;
 
                /* XXX notify callback on error. */
-               psm->what = RPMCALLBACK_UNPACK_ERROR;
-               psm->amount = 0;
-               psm->total = 0;
-               rpmpsmNext(psm, PSM_NOTIFY);
-
+               rpmtsNotify(ts, psm->te, RPMCALLBACK_UNPACK_ERROR, 0, 0);
                break;
            }
        }
@@ -955,10 +951,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
                        psm->goalName, cpioStrerror(rc));
 
            /* XXX notify callback on error. */
-           psm->what = RPMCALLBACK_CPIO_ERROR;
-           psm->amount = 0;
-           psm->total = 0;
-           rpmpsmNext(psm, PSM_NOTIFY);
+           rpmtsNotify(ts, psm->te, RPMCALLBACK_CPIO_ERROR, 0, 0);
        }
 
        psm->failedFile = _free(psm->failedFile);