mirror of
https://github.com/systemd/systemd.git
synced 2025-03-24 14:50:17 +03:00
systemctl: when called as shutdown, properly handle user specified wall message
This commit is contained in:
parent
33be102a21
commit
e4a9373fb3
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user