]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
unit: line-break overly long parameter list + add assert()
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Sep 2025 08:12:52 +0000 (10:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 13 Oct 2025 14:59:40 +0000 (16:59 +0200)
(cherry picked from commit 8e9b722b4ad94d1739810ff2792b9c03ba5c850e)

src/core/unit.c

index 7d9e24c5de893a0d6072f30b511acf51b3f5f9d5..137b6b4e07d9da1683de366d13ae3204d1fc98c0 100644 (file)
@@ -1825,7 +1825,15 @@ static bool unit_test_assert(Unit *u) {
         return u->assert_result;
 }
 
-void unit_status_printf(Unit *u, StatusType status_type, const char *status, const char *format, const char *ident) {
+void unit_status_printf(
+                Unit *u,
+                StatusType status_type,
+                const char *status,
+                const char *format,
+                const char *ident) {
+
+        assert(u);
+
         if (log_get_show_color()) {
                 if (u->manager->status_unit_format == STATUS_UNIT_FORMAT_COMBINED && strchr(ident, ' '))
                         ident = strjoina(ANSI_HIGHLIGHT, u->id, ANSI_NORMAL, " - ", u->description);