]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/metrics: add two more assertions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Feb 2026 06:26:21 +0000 (15:26 +0900)
committerMike Yuan <me@yhndnzj.com>
Mon, 16 Feb 2026 08:44:58 +0000 (09:44 +0100)
src/shared/metrics.c

index 0fc25ea7b5bd977d0b87cc995de8db5d84723096..5e0b0a115884b64b89aabbe4d5bb733eb831aef4 100644 (file)
@@ -20,6 +20,8 @@ int metrics_setup_varlink_server(
 
         assert(server);
         assert(event);
+        assert(vl_method_list_cb);
+        assert(vl_method_describe_cb);
 
         if (*server)
                 return 0;
@@ -34,10 +36,8 @@ int metrics_setup_varlink_server(
 
         r = sd_varlink_server_bind_method_many(
                         s,
-                        "io.systemd.Metrics.List",
-                        vl_method_list_cb,
-                        "io.systemd.Metrics.Describe",
-                        vl_method_describe_cb);
+                        "io.systemd.Metrics.List",     vl_method_list_cb,
+                        "io.systemd.Metrics.Describe", vl_method_describe_cb);
         if (r < 0)
                 return log_debug_errno(r, "Failed to register varlink metrics methods: %m");