From: Theodore Tso Date: Fri, 2 Nov 1990 10:35:36 +0000 (+0000) Subject: Fixed bug in the unlocking routine so it really would call flock X-Git-Tag: krb5-1.0-alpha2~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4d074159ef7344f313578e31b30eb375f162c14a;p=krb5.git Fixed bug in the unlocking routine so it really would call flock when it was supposed to. (oops!) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1399 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/kdb_dbm.c b/src/lib/kdb/kdb_dbm.c index bc2fd26b0..6044e0c85 100644 --- a/src/lib/kdb/kdb_dbm.c +++ b/src/lib/kdb/kdb_dbm.c @@ -64,8 +64,6 @@ static krb5_error_code decode_princ_contents PROTOTYPE((datum *, krb5_db_entry * )); static void free_decode_princ_contents PROTOTYPE((krb5_db_entry * )); -static krb5_error_code krb5_dbm_db_lock PROTOTYPE((int )); -static krb5_error_code krb5_dbm_db_unlock PROTOTYPE((void )); #if 0 /* not used */ @@ -538,7 +536,7 @@ krb5_db_entry *entry; return; } -static krb5_error_code +krb5_error_code krb5_dbm_db_lock(mode) int mode; { @@ -569,13 +567,13 @@ int mode; return 0; } -static krb5_error_code +krb5_error_code krb5_dbm_db_unlock() { if (!mylock) /* lock already unlocked */ return KRB5_KDB_NOTLOCKED; - if (--mylock) { + if (--mylock == 0) { if (flock(dblfd, LOCK_UN) < 0) return errno; }