X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl.c;h=68e4a909eb6e4b8cc586ba6661ca30277f68af0e;hp=447a24458adc31071c6189365851e82ec9c2b09c;hb=e4a9373fb3ddeadd6b847449186fadf5963695f7;hpb=d55ae9e6d7a20bb79f60a154bfcf4348dfb06852 diff --git a/src/systemctl.c b/src/systemctl.c index 447a24458..68e4a909e 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -39,6 +39,7 @@ #include "utmp-wtmp.h" #include "special.h" #include "initreq.h" +#include "strv.h" static const char *arg_type = NULL; static bool arg_all = false; @@ -139,6 +140,23 @@ static void warn_wall(enum action action) { if (arg_no_wall) return; + if (arg_wall) { + char *p; + + if (!(p = strv_join(arg_wall, " "))) { + log_error("Failed to join strings."); + return; + } + + if (*p) { + utmp_wall(p); + free(p); + return; + } + + free(p); + } + if (!table[action]) return;