]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mute-console: io.systemd.MuteConsole requires 'more'
authorMike Yuan <me@yhndnzj.com>
Sun, 8 Feb 2026 20:57:01 +0000 (21:57 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 16 Feb 2026 08:44:54 +0000 (09:44 +0100)
src/mute-console/mute-console.c
src/shared/varlink-io.systemd.MuteConsole.c

index 40c0839367b97740161e28ea9af7babd19468027..b18e79d622c2eee0b820ca10f43169693d2689ff 100644 (file)
@@ -273,6 +273,7 @@ static int vl_method_mute(
         int r;
 
         assert(link);
+        assert(FLAGS_SET(flags, SD_VARLINK_METHOD_MORE));
 
         _cleanup_free_ Context *nc = new(Context, 1);
         if (!nc)
@@ -294,9 +295,6 @@ static int vl_method_mute(
         if (r != 0)
                 return r;
 
-        if (!FLAGS_SET(flags, SD_VARLINK_METHOD_MORE))
-                return sd_varlink_error(link, SD_VARLINK_ERROR_EXPECTED_MORE, NULL);
-
         r = sd_varlink_server_bind_disconnect(sd_varlink_get_server(link), vl_on_disconnect);
         if (r < 0)
                 return r;
index 0cea5b85548921bb34b840d29cd0d3b0cae579b6..723b19985e8be1c227b2f0c2090d72f32e12948d 100644 (file)
@@ -4,8 +4,9 @@
 
 #include "varlink-io.systemd.MuteConsole.h"
 
-static SD_VARLINK_DEFINE_METHOD(
+static SD_VARLINK_DEFINE_METHOD_FULL(
                 Mute,
+                SD_VARLINK_REQUIRES_MORE,
                 SD_VARLINK_FIELD_COMMENT("Whether to mute the kernel's output to the console (defaults to true)."),
                 SD_VARLINK_DEFINE_INPUT(kernel, SD_VARLINK_BOOL, SD_VARLINK_NULLABLE),
                 SD_VARLINK_FIELD_COMMENT("Whether to mute PID1's output to the console (defaults to true)."),