X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshutdownd%2Fshutdownd.c;h=c0747415fd845dd1d38438d825b29ced7c5d168b;hp=9dd13361331fefedf8bec03a7ecb867b620ee246;hb=dfcc5c33f42554a5293e68e7093da2403e363997;hpb=669241a076108e0483d7d8475beaa506106d077e diff --git a/src/shutdownd/shutdownd.c b/src/shutdownd/shutdownd.c index 9dd133613..c0747415f 100644 --- a/src/shutdownd/shutdownd.c +++ b/src/shutdownd/shutdownd.c @@ -136,6 +136,8 @@ static void warn_wall(usec_t n, struct sd_shutdown_command *c) { prefix = "The system is going down for reboot at "; else if (c->mode == SD_SHUTDOWN_KEXEC) prefix = "The system is going down for kexec reboot at "; + else if (c->mode == SD_SHUTDOWN_NONE) + prefix = "The system shutdown has been cancelled at "; else assert_not_reached("Unknown mode!"); @@ -212,10 +214,8 @@ static int update_schedule_file(struct sd_shutdown_command *c) { } t = cescape(c->wall_message); - if (!t) { - log_error("Out of memory."); - return -ENOMEM; - } + if (!t) + return log_oom(); r = fopen_temporary("/run/systemd/shutdown/scheduled", &f, &temp_path); if (r < 0) { @@ -356,6 +356,8 @@ int main(int argc, char *argv[]) { if (!scheduled(&b.command)) { log_info("Shutdown canceled."); + if (b.command.warn_wall) + warn_wall(0, &b.command); break; }