diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-03-28 07:45:24 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-03-28 07:45:24 +0000 |
commit | 0ef95757d6fed29b99d1ea08b78732b2a7fe0e2c (patch) | |
tree | 533229e29f3d37f6cad859b97cc2d2d9b2dce6fd /lib/libalpm/remove.c | |
parent | 350a3972d1d372a009c67aba5af4ff0d3e25e813 (diff) | |
download | pacman-0ef95757d6fed29b99d1ea08b78732b2a7fe0e2c.tar.xz |
added a FREELISTPTR macro to free a PMList without freeing its data
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r-- | lib/libalpm/remove.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index b6e2452b..1c6e4806 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -65,7 +65,7 @@ int remove_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name) int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) { pmpkg_t *info; - PMList *lp, *i; + PMList *lp; ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); @@ -104,10 +104,7 @@ int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) _alpm_log(PM_LOG_FLOW1, "sorting by dependencies"); lp = sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE); /* free the old alltargs */ - for(i = trans->packages; i; i = i->next) { - i->data = NULL; - } - FREELIST(trans->packages); + FREELISTPTR(trans->packages); trans->packages = lp; TRANS_CB(trans, PM_TRANS_EVT_DEPS_DONE, NULL, NULL); @@ -228,16 +225,12 @@ int remove_commit(pmdb_t *db, pmtrans_t *trans) /* look for a provides package */ PMList *provides = _alpm_db_whatprovides(db, depend.name); if(provides) { - PMList *p; /* TODO: should check _all_ packages listed in provides, not just * the first one. */ /* use the first one */ depinfo = db_scan(db, ((pmpkg_t *)provides->data)->name, INFRQ_DESC|INFRQ_DEPENDS); - for(p = provides; p; p = p->next) { - p->data = NULL; - } - FREELIST(provides); + FREELISTPTR(provides); if(depinfo == NULL) { /* wtf */ continue; |