From da5fb86100250cb45a00b2742c25b0d1a4c636c2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 4 Jan 2018 21:00:10 +0100 Subject: [PATCH] manager: swap order in which we ellipsize/escape sd_notify() messages for debugging If we have to chose between truncated escape sequences and strings exploded to 4 times the desried length by fully escaping, prefer the latter. It's for debug only, hence doesn't really matter much. --- src/core/manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index a9c4330897..07809fea9c 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1897,9 +1897,10 @@ static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const else if (DEBUG_LOGGING) { _cleanup_free_ char *x = NULL, *y = NULL; - x = cescape(buf); + x = ellipsize(buf, 20, 90); if (x) - y = ellipsize(x, 20, 90); + y = cescape(x); + log_unit_debug(u, "Got notification message \"%s\", ignoring.", strnull(y)); } }