summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:13:28 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:13:28 +0930
commit26ce47ecc09537d3ee6dff205f3dd564a74e6301 (patch)
treefa274a5797c2631c3646aff106fd373f31385a58 /source3/lib
parent5e0f62c3c20250a7fdb4be11f08bd407b11a204b (diff)
downloadsamba-26ce47ecc09537d3ee6dff205f3dd564a74e6301.tar.gz
samba-26ce47ecc09537d3ee6dff205f3dd564a74e6301.tar.bz2
samba-26ce47ecc09537d3ee6dff205f3dd564a74e6301.zip
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 <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_tdb.c4
1 files 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);