diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-06-18 20:23:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-06-18 20:23:17 +0200 |
commit | e4a9373fb3ddeadd6b847449186fadf5963695f7 (patch) | |
tree | 4f5dd7a030627d6b3b8126f4f52fd473b9701519 /src/systemctl.c | |
parent | 33be102a214e7010949496549f4c737b0f8269a3 (diff) |
systemctl: when called as shutdown, properly handle user specified wall message
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index 447a24458a..68e4a909eb 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; |