tdb2: cleanup oob handling.
commit34c2d1658a89462e9b34210cb19fe9ab33bc2194
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 13 Sep 2011 21:39:13 +0000 (14 07:09 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 13 Sep 2011 21:39:13 +0000 (14 07:09 +0930)
treeb9623d98da69e9987daa37e1fe2cfbc10efd16a2
parent1bba793fd64f635b8055a34973cded1f67e958e4
tdb2: cleanup oob handling.

The tdb_oob() function can fail due to errors, as well as because the length
asked for is greater than the size of the file.  Clean that up:

(1) If probe is true, only fail if there's an error, not if the length is
    too great.
(2) Exit tdb_open() if it tdb_oob() probe fails; this helps cut down
    test time for failtest.
(3) Don't set probe to true in tdb_direct() fail; a minor issue, but it means
    we log failure.

(Imported from CCAN commit 77658070a3e4f712b94d659b2e399031ce3394c8)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/tdb2/io.c
lib/tdb2/open.c
lib/tdb2/transaction.c