From 26ce47ecc09537d3ee6dff205f3dd564a74e6301 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 08:13:28 +0930 Subject: util_tdb: return -1/0 from lock_with_timeout functions. Keeps the tdb2 API change (which returns error codes, rather than -1) localized. The function returns -1 down the other path, so make it consistent. Signed-off-by: Rusty Russell --- source3/lib/util_tdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index 1ba5ed4120..aea5c74650 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -102,7 +102,7 @@ static int tdb_chainlock_with_timeout_internal(struct tdb_context *tdb, locking.base.attr = TDB_ATTRIBUTE_FLOCK; ecode = tdb_get_attribute(tdb, &locking); if (ecode != TDB_SUCCESS) - return ecode; + return -1; /* Replace locking function with our own. */ locking.flock.data = &timeout; @@ -110,7 +110,7 @@ static int tdb_chainlock_with_timeout_internal(struct tdb_context *tdb, ecode = tdb_set_attribute(tdb, &locking); if (ecode != TDB_SUCCESS) - return ecode; + return -1; } if (rw_type == F_RDLCK) ecode = tdb_chainlock_read(tdb, key); -- cgit