diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-03-26 14:33:17 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-03-29 15:14:30 +1030 |
commit | 3acce707a32a28c309133583b8cd1a554f19a8b3 (patch) | |
tree | bdc3c7320700e027fbe9b24cc2f977e079ae3680 /lib | |
parent | e36622f92616b6982bf875563728dc8cdf97c93c (diff) | |
download | samba-3acce707a32a28c309133583b8cd1a554f19a8b3.tar.gz samba-3acce707a32a28c309133583b8cd1a554f19a8b3.tar.bz2 samba-3acce707a32a28c309133583b8cd1a554f19a8b3.zip |
tdb2: fix prototype in tdb1 code.
We were handing an int-returning function where we should hand an enum TDB_ERROR
returning function. Worse, it was returning 0/-1 instead of 0/TDB_ERR_*.
Fortunately, it's only compared against success, but the Solaris compiler
warns about it, and it's not correct anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb2/tdb1_tdb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/tdb2/tdb1_tdb.c b/lib/tdb2/tdb1_tdb.c index 869672a578..ae633ed77b 100644 --- a/lib/tdb2/tdb1_tdb.c +++ b/lib/tdb2/tdb1_tdb.c @@ -146,17 +146,17 @@ tdb1_off_t tdb1_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t h static TDB_DATA _tdb1_fetch(struct tdb_context *tdb, TDB_DATA key); -static int tdb_update_hash_cmp(TDB_DATA key, TDB_DATA data, void *private_data) +static enum TDB_ERROR tdb_update_hash_cmp(TDB_DATA key, TDB_DATA data, void *private_data) { TDB_DATA *dbuf = (TDB_DATA *)private_data; if (dbuf->dsize != data.dsize) { - return -1; + return TDB_ERR_EINVAL; } if (memcmp(dbuf->dptr, data.dptr, data.dsize) != 0) { - return -1; + return TDB_ERR_EINVAL; } - return 0; + return TDB_SUCCESS; } /* update an entry in place - this only works if the new data size @@ -177,7 +177,7 @@ static int tdb1_update_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash if (rec.key_len == key.dsize && rec.data_len == dbuf.dsize && rec.full_hash == hash && - tdb1_parse_record(tdb, key, tdb_update_hash_cmp, &dbuf) == 0) { + tdb1_parse_record(tdb, key, tdb_update_hash_cmp, &dbuf) == TDB_SUCCESS) { return 0; } |