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>
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;
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);