tdb2: don't continue if tdb1_find fails.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Aug 2011 06:08:53 +0000 (15:38 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Aug 2011 06:08:53 +0000 (15:38 +0930)
commit1be090a2d749713cfd0c4584cafb97bffd716189
treecc67026f78315722fd97591586c3736ed32c3218
parent818ed29730b030ce79855fc35c212b51adff3180
tdb2: don't continue if tdb1_find fails.

The TDB1 code's tdb1_find() returns 0 on error; the callers should
not assume that the error means that the entry wasn't found, but use
last_error to determine it.

This was found by looking at how long the failure path testing for
test/run-10-simple-store.c was taking under valgrind, ie:

valgrind -q ./run-10-simple-store --show-slowest

This change dropped the time for that test from 53 seconds to 19
seconds.
ccan/tdb2/tdb1_tdb.c