summaryrefslogtreecommitdiffstats
path: root/src/lib/kdb/kdb5.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-05-10 14:01:48 -0400
committerGreg Hudson <ghudson@mit.edu>2013-05-14 13:31:41 -0400
commit6350fd0c909d84c00200885e722cc902049ada05 (patch)
treea880eae4b875d2b94747048a7092f619c79d33c2 /src/lib/kdb/kdb5.c
parent1799f7b5d9cf4390148248d603d99a3695ddfafe (diff)
downloadkrb5-6350fd0c909d84c00200885e722cc902049ada05.tar.gz
krb5-6350fd0c909d84c00200885e722cc902049ada05.tar.xz
krb5-6350fd0c909d84c00200885e722cc902049ada05.zip
Assume mutex locking cannot fail
Locking and unlocking a non-recursive mutex is a simple memory operation and should not fail on any reasonable platform with correct usage. A pthread mutex can return EDEADLK on lock or EPERM on unlock, or EINVAL if the mutex is uninitialized, but all of these conditions would reflect serious bugs in the calling code. Change the k5_mutex_lock and k5_mutex_unlock wrappers to return void and adjust all call sites. Propagate this change through k5_cc_mutex_lock and k5_cc_mutex_unlock as well.
Diffstat (limited to 'src/lib/kdb/kdb5.c')
-rw-r--r--src/lib/kdb/kdb5.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c
index 779ce93220..82dcfd2a3e 100644
--- a/src/lib/kdb/kdb5.c
+++ b/src/lib/kdb/kdb5.c
@@ -89,7 +89,8 @@ kdb_lock_list()
err = CALL_INIT_FUNCTION (kdb_init_lock_list);
if (err)
return err;
- return k5_mutex_lock(&db_lock);
+ k5_mutex_lock(&db_lock);
+ return 0;
}
void
@@ -99,10 +100,10 @@ kdb_fini_lock_list()
k5_mutex_destroy(&db_lock);
}
-static int
+static void
kdb_unlock_list()
{
- return k5_mutex_unlock(&db_lock);
+ k5_mutex_unlock(&db_lock);
}
/* Return true if the ulog is mapped in the master role. */