diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:57:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:57:13 +0930 |
commit | 014ca657e600ee2b3b4dc9d2ef482d050cd0917d (patch) | |
tree | 8618af13d707f8e7d7a6ceb80db557421851c48c /lib/tdb2/tdb1_io.c | |
parent | 9140fca812063be69842a6c64030e32c65c9dff1 (diff) | |
download | samba-014ca657e600ee2b3b4dc9d2ef482d050cd0917d.tar.gz samba-014ca657e600ee2b3b4dc9d2ef482d050cd0917d.tar.bz2 samba-014ca657e600ee2b3b4dc9d2ef482d050cd0917d.zip |
tdb2: unify tdb1_parse_record into tdb_parse_record
Switch on the TDB_VERSION1 flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 3352e4e947777d4a90a2dd4f3037e1e494231b25)
Diffstat (limited to 'lib/tdb2/tdb1_io.c')
-rw-r--r-- | lib/tdb2/tdb1_io.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/tdb2/tdb1_io.c b/lib/tdb2/tdb1_io.c index 70a660cf53..8219e93046 100644 --- a/lib/tdb2/tdb1_io.c +++ b/lib/tdb2/tdb1_io.c @@ -435,15 +435,15 @@ unsigned char *tdb1_alloc_read(struct tdb_context *tdb, tdb1_off_t offset, tdb1_ } /* Give a piece of tdb data to a parser */ - -int tdb1_parse_data(struct tdb_context *tdb, TDB_DATA key, - tdb1_off_t offset, tdb1_len_t len, - int (*parser)(TDB_DATA key, TDB_DATA data, - void *private_data), - void *private_data) +enum TDB_ERROR tdb1_parse_data(struct tdb_context *tdb, TDB_DATA key, + tdb1_off_t offset, tdb1_len_t len, + enum TDB_ERROR (*parser)(TDB_DATA key, + TDB_DATA data, + void *private_data), + void *private_data) { TDB_DATA data; - int result; + enum TDB_ERROR result; data.dsize = len; @@ -453,14 +453,14 @@ int tdb1_parse_data(struct tdb_context *tdb, TDB_DATA key, * parser directly at the mmap area. */ if (tdb->tdb1.io->tdb1_oob(tdb, offset+len, 0) != 0) { - return -1; + return tdb->last_error; } data.dptr = offset + (unsigned char *)tdb->file->map_ptr; return parser(key, data, private_data); } if (!(data.dptr = tdb1_alloc_read(tdb, offset, len))) { - return -1; + return tdb->last_error; } result = parser(key, data, private_data); |