From b34953dd5e0e15fdf5c1a9a0205420e64bd91ace Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 6 Sep 2021 22:08:27 +0930 Subject: [PATCH] ccan: update to get version where tal_dump goes to stderr. This is useful for plugins which can't send junk to stdout. Signed-off-by: Rusty Russell --- ccan/README | 2 +- ccan/ccan/tal/tal.c | 16 ++++++++-------- ccan/ccan/tal/tal.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ccan/README b/ccan/README index 289e9cf25..2c869c33c 100644 --- a/ccan/README +++ b/ccan/README @@ -1,3 +1,3 @@ CCAN imported from http://ccodearchive.net. -CCAN version: init-2506-gec95c3c5 +CCAN version: init-2507-g05ec8351 diff --git a/ccan/ccan/tal/tal.c b/ccan/ccan/tal/tal.c index a49541114..fec47ac5c 100644 --- a/ccan/ccan/tal/tal.c +++ b/ccan/ccan/tal/tal.c @@ -824,36 +824,36 @@ static void dump_node(unsigned int indent, const struct tal_hdr *t) const struct prop_hdr *p; for (i = 0; i < indent; i++) - printf(" "); - printf("%p len=%zu", t, t->bytelen); + fprintf(stderr, " "); + fprintf(stderr, "%p len=%zu", t, t->bytelen); for (p = t->prop; p; p = p->next) { struct children *c; struct name *n; struct notifier *no; if (is_literal(p)) { - printf(" \"%s\"", (const char *)p); + fprintf(stderr, " \"%s\"", (const char *)p); break; } switch (p->type) { case CHILDREN: c = (struct children *)p; - printf(" CHILDREN(%p):parent=%p,children={%p,%p}\n", + fprintf(stderr, " CHILDREN(%p):parent=%p,children={%p,%p}\n", p, c->parent, c->children.n.prev, c->children.n.next); break; case NAME: n = (struct name *)p; - printf(" NAME(%p):%s", p, n->name); + fprintf(stderr, " NAME(%p):%s", p, n->name); break; case NOTIFIER: no = (struct notifier *)p; - printf(" NOTIFIER(%p):fn=%p", p, no->u.notifyfn); + fprintf(stderr, " NOTIFIER(%p):fn=%p", p, no->u.notifyfn); break; default: - printf(" **UNKNOWN(%p):%i**", p, p->type); + fprintf(stderr, " **UNKNOWN(%p):%i**", p, p->type); } } - printf("\n"); + fprintf(stderr, "\n"); } static void tal_dump_(unsigned int level, const struct tal_hdr *t) diff --git a/ccan/ccan/tal/tal.h b/ccan/ccan/tal/tal.h index 20cd89c5e..a3a154915 100644 --- a/ccan/ccan/tal/tal.h +++ b/ccan/ccan/tal/tal.h @@ -456,7 +456,7 @@ bool tal_check(const tal_t *ctx, const char *errorstr); #ifdef CCAN_TAL_DEBUG /** - * tal_dump - dump entire tal tree. + * tal_dump - dump entire tal tree to stderr. * * This is a helper for debugging tal itself, which dumps all the tal internal * state.