Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2007-07-07 21:24:30 +0200
committerDan McGee <dan@archlinux.org>2007-08-15 20:22:31 -0400
commit8038190c7c4786e1c49494eea1b40cdddcbd5136 (patch)
treede1fe4e18ee65a4539ce579239178b9c2a914872 /lib/libalpm/db.c
parent0f539832f45fa2c183cfe52c1881b3acaa54e3e6 (diff)
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 <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c3
1 files changed, 2 insertions, 1 deletions
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;