svn rev #21848: trunk/src/plugins/kdb/db2/

raeburn@MIT.EDU raeburn at MIT.EDU
Fri Jan 30 20:07:05 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21848
Commit By: raeburn
Log Message:
recode as more straight-line code to simplify analysis


Changed Files:
U   trunk/src/plugins/kdb/db2/kdb_db2.c
Modified: trunk/src/plugins/kdb/db2/kdb_db2.c
===================================================================
--- trunk/src/plugins/kdb/db2/kdb_db2.c	2009-01-31 00:54:33 UTC (rev 21847)
+++ trunk/src/plugins/kdb/db2/kdb_db2.c	2009-01-31 01:07:04 UTC (rev 21848)
@@ -1197,6 +1197,8 @@
 #endif
     }
     while (dbret == 0) {
+	krb5_error_code retval2;
+
 	contdata.data = contents.data;
 	contdata.length = contents.size;
 	retval = krb5_decode_princ_contents(context, &contdata, &entries);
@@ -1207,16 +1209,16 @@
 	    break;
 	retval = (*func) (func_arg, &entries);
 	krb5_dbe_free_contents(context, &entries);
+	retval2 = k5_mutex_lock(krb5_db2_mutex);
 	/* Note: If re-locking fails, the wrapper in db2_exp.c will
 	   still try to unlock it again.  That would be a bug.  Fix
 	   when integrating the locking better.  */
-	if (retval) {
-	    (void) k5_mutex_lock(krb5_db2_mutex);
+	if (retval)
 	    break;
+	if (retval2) {
+	    retval = retval2;
+	    break;
 	}
-	retval = k5_mutex_lock(krb5_db2_mutex);
-	if (retval)
-	    break;
 	if (!recursive) {
 	    dbret = (*db->seq) (db, &key, &contents,
 				backwards ? R_PREV : R_NEXT);




More information about the cvs-krb5 mailing list