]> git.ozlabs.org Git - ccan-lca-2011.git/commitdiff
tdb2: clean up logging
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 12:41:51 +0000 (23:11 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 12:41:51 +0000 (23:11 +1030)
Logged errors should always set tdb->ecode before they are called, and
there's little reason to have a sprintf-style logging function since
we can do the formatting internally.

Change the tdb_log attribute to just take a "const char *", and create
a new tdb_logerr() helper which sets ecode and calls it.  As a bonus,
mark it COLD so the compiler can optimize appropriately knowing that
it's unlikely to be invoked.


No differences found