chiark / gitweb /
macro: don't redefine CLAMP if it is already defined by glib or some other library
[elogind.git] / src / shutdownd / shutdownd.c
index d426d9833d79359f7c340d8ea137e620b30d5e57..0464c891878fc8b12f952521facf62f570ee3f68 100644 (file)
@@ -38,6 +38,7 @@
 #include "util.h"
 #include "utmp-wtmp.h"
 #include "mkdir.h"
+#include "fileio.h"
 
 union shutdown_buffer {
         struct sd_shutdown_command command;
@@ -136,6 +137,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!");
 
@@ -354,6 +357,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;
                                 }