Fixes to lock nesting code.
This commit is contained in:

committed by
Nicolas Williams

parent
58d72035f1
commit
abd94953e2
@@ -68,9 +68,9 @@ DB_lock(krb5_context context, HDB *db, int operation)
|
|||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
|
|
||||||
if (db->lock_count > 0) {
|
if (db->lock_count > 0) {
|
||||||
assert( db->lock_type == HDB_WLOCK );
|
|
||||||
db->lock_count++;
|
db->lock_count++;
|
||||||
return 0;
|
if (db->lock_type == HDB_WLOCK || db->lock_type == operation)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
|
@@ -77,10 +77,10 @@ DB_lock(krb5_context context, HDB *db, int operation)
|
|||||||
int fd;
|
int fd;
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
|
|
||||||
if (db->lock_count > 0) {
|
if (db->lock_count > 1) {
|
||||||
assert( db->lock_type == HDB_WLOCK );
|
|
||||||
db->lock_count++;
|
db->lock_count++;
|
||||||
return 0;
|
if (db->lock_count == HDB_WLOCK || db->lock_count == operation)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*d->fd)(d, &fd))
|
if ((*d->fd)(d, &fd))
|
||||||
|
@@ -650,10 +650,10 @@ mdb_lock(krb5_context context, HDB *db, int operation)
|
|||||||
int fd = (*d->fd)(d);
|
int fd = (*d->fd)(d);
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
|
|
||||||
if (db->lock_count > 0) {
|
if (db->lock_count > 1) {
|
||||||
assert( db->lock_type == HDB_WLOCK );
|
|
||||||
db->lock_count++;
|
db->lock_count++;
|
||||||
return 0;
|
if (db->lock_type == HDB_WLOCK || db->lock_count == operation)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
|
Reference in New Issue
Block a user