]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: swap order in which we ellipsize/escape sd_notify() messages for debugging
authorLennart Poettering <lennart@poettering.net>
Thu, 4 Jan 2018 20:00:10 +0000 (21:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jan 2018 14:12:16 +0000 (15:12 +0100)
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

index a9c4330897e9970c5535c0adede5c4144319fea1..07809fea9c7c42feef199761dc6a8756fda76a92 100644 (file)
@@ -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));
         }
 }