From: Rusty Russell Date: Tue, 1 Mar 2011 12:49:20 +0000 (+1030) Subject: tdb2: log an error when out of memory formatting message. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=8da574fe7c6021afcb0afb8ae3a6bd462ee14413;ds=inline tdb2: log an error when out of memory formatting message. Log it at level ERROR and log the raw unformatted message at the requested level. --- diff --git a/ccan/tdb2/tdb.c b/ccan/tdb2/tdb.c index 03d51c21..fa890ec8 100644 --- a/ccan/tdb2/tdb.c +++ b/ccan/tdb2/tdb.c @@ -737,8 +737,9 @@ void COLD tdb_logerr(struct tdb_context *tdb, message = malloc(len + 1); if (!message) { - tdb->logfn(tdb, level, tdb->log_private, - "out of memory formatting message"); + tdb->logfn(tdb, TDB_DEBUG_ERROR, tdb->log_private, + "out of memory formatting message:"); + tdb->logfn(tdb, level, tdb->log_private, fmt); return; } va_start(ap, fmt);