* Fixed an error message that should be a debug message
* Fixed "the big segfault" - dbs_sync list was being modified while iterating * over the list, big No-No. Now using a while loop over alpm_list_count.
This commit is contained in:
parent
34931106d7
commit
55f178c629
2 changed files with 7 additions and 5 deletions
|
@ -100,7 +100,7 @@ int alpm_initialize(char *root)
|
||||||
*/
|
*/
|
||||||
int alpm_release()
|
int alpm_release()
|
||||||
{
|
{
|
||||||
pmlist_t *i;
|
int dbs_left = 0;
|
||||||
|
|
||||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||||
|
|
||||||
|
@ -115,9 +115,11 @@ int alpm_release()
|
||||||
handle->db_local = NULL;
|
handle->db_local = NULL;
|
||||||
}
|
}
|
||||||
/* and also sync ones */
|
/* and also sync ones */
|
||||||
for(i = handle->dbs_sync; i; i = i->next) {
|
while((dbs_left = alpm_list_count(handle->dbs_sync)) > 0) {
|
||||||
alpm_db_unregister(i->data);
|
pmdb_t *db = (pmdb_t *)handle->dbs_sync->data;
|
||||||
i->data = NULL;
|
_alpm_log(PM_LOG_DEBUG, _("removing DB %s, %d remaining..."), db->treename, dbs_left);
|
||||||
|
alpm_db_unregister(db);
|
||||||
|
db = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FREEHANDLE(handle);
|
FREEHANDLE(handle);
|
||||||
|
|
|
@ -189,7 +189,7 @@ int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(info == NULL || info->name[0] == 0 || info->version[0] == 0) {
|
if(info == NULL || info->name[0] == 0 || info->version[0] == 0) {
|
||||||
_alpm_log(PM_LOG_ERROR, _("invalid package entry provided to _alpm_db_read"));
|
_alpm_log(PM_LOG_DEBUG, _("invalid package entry provided to _alpm_db_read, skipping"));
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue