]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: fix assignment of object_field
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Jan 2025 15:13:19 +0000 (00:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Jan 2025 18:34:11 +0000 (03:34 +0900)
Prompted by #36000.

src/analyze/analyze-condition.c

index 1e9136d7c0751d89f4418ed4539a4b8cc6a6b4a1..e7871060fe5a6e8715c4231e9dd09f0c7c818cc8 100644 (file)
@@ -54,6 +54,7 @@ static int parse_condition(Unit *u, const char *line) {
 _printf_(7, 8)
 static int log_helper(void *userdata, int level, int error, const char *file, int line, const char *func, const char *format, ...) {
         Unit *u = ASSERT_PTR(userdata);
+        Manager *m = ASSERT_PTR(u->manager);
         va_list ap;
         int r;
 
@@ -62,10 +63,10 @@ static int log_helper(void *userdata, int level, int error, const char *file, in
 
         va_start(ap, format);
         r = log_object_internalv(level, error, file, line, func,
-                                 NULL,
-                                 u->id,
-                                 NULL,
-                                 NULL,
+                                 /* object_field = */ m->unit_log_field,
+                                 /* object = */ u->id,
+                                 /* extra_field = */ NULL,
+                                 /* extra = */ NULL,
                                  format, ap);
         va_end(ap);