From 8038190c7c4786e1c49494eea1b40cdddcbd5136 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 7 Jul 2007 21:24:30 +0200 Subject: libalpm/db.c : allow unregistering db for interrupted transaction. This prevents alpm_release to loop infinitely in case of an interrupted transaction, where the database wasn't unregistered. alpm_release should probably also be fixed, as it can still loop if db_unregister fails for another reason. Signed-off-by: Chantry Xavier --- lib/libalpm/db.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index cc489396..306d0b96 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -84,7 +84,8 @@ int SYMEXPORT alpm_db_unregister(pmdb_t *db) ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(db != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); /* Do not unregister a database if a transaction is on-going */ - ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1)); + ASSERT(handle->trans == NULL || handle->trans->state == STATE_INTERRUPTED, + RET_ERR(PM_ERR_TRANS_NOT_NULL, -1)); if(db == handle->db_local) { handle->db_local = NULL; -- cgit v1.2.3-70-g09d2