Panu Matilainen 8e7106
commit 4f7fe5e668e9cd8ba62e700f6f3fdaf2256306d8
Panu Matilainen 8e7106
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 8e7106
Date:   Mon Feb 21 10:55:02 2011 +0200
Panu Matilainen 8e7106
Panu Matilainen 8e7106
    Fix db cursor double-open, causing yum to hang on reinstall (RhBug:678644)
Panu Matilainen 8e7106
    - A refactoring error in commit 475391dc581bf5ba72b6d59d16d875505b45bd51
Panu Matilainen 8e7106
      causes us to open a double cursor on the Package db. This doesn't
Panu Matilainen 8e7106
      seem to affect much in rpm context, but Yum is being naughty and holding
Panu Matilainen 8e7106
      two different handles to the same db simultaneously, which causes
Panu Matilainen 8e7106
      to deadlock on trying to lock the same record twice from two different
Panu Matilainen 8e7106
      handles .. or something to that effect.
Panu Matilainen 8e7106
Panu Matilainen 8e7106
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
Panu Matilainen 8e7106
index dc6d7a7..eb7a49d 100644
Panu Matilainen 8e7106
--- a/lib/rpmdb.c
Panu Matilainen 8e7106
+++ b/lib/rpmdb.c
Panu Matilainen 8e7106
@@ -2331,7 +2331,6 @@ static int updatePackages(dbiIndex dbi, unsigned int hdrNum, DBT *hdr)
Panu Matilainen 8e7106
 	DBT data;
Panu Matilainen 8e7106
 
Panu Matilainen 8e7106
 	memset(&data, 0, sizeof(data));
Panu Matilainen 8e7106
-	xx = dbiCopen(dbi, &dbcursor, DB_WRITECURSOR);
Panu Matilainen 8e7106
 	rc = dbiGet(dbi, dbcursor, &key, &data, DB_SET);
Panu Matilainen 8e7106
 	if (rc) {
Panu Matilainen 8e7106
 	    rpmlog(RPMLOG_ERR,