From: Lennart Poettering Date: Tue, 16 Jun 2026 12:21:36 +0000 (+0200) Subject: mute-console: allow NULL being passed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=846b0efb04a60f0e4f88084994e6094306caff13;p=thirdparty%2Fsystemd.git mute-console: allow NULL being passed --- diff --git a/src/shared/prompt-util.c b/src/shared/prompt-util.c index 7837a90fa40..a7bcfe32e33 100644 --- a/src/shared/prompt-util.c +++ b/src/shared/prompt-util.c @@ -412,11 +412,12 @@ static int vl_on_reply(sd_varlink *link, sd_json_variant *parameters, const char int mute_console(sd_varlink **ret_link) { int r; - assert(ret_link); - /* Talks to the MuteConsole service, and asks for output to the console to be muted, as long as the * connection is retained */ + if (!ret_link) + return 0; + _cleanup_(sd_varlink_flush_close_unrefp) sd_varlink *link = NULL; r = sd_varlink_connect_address(&link, "/run/systemd/io.systemd.MuteConsole"); if (r < 0)