chiark / gitweb /
Prep v232.2: libelogind.sym: Rename LIBELOGIND back to LIBSYSTEMD.
[elogind.git] / src / login / eloginctl.c
index 0b4dc84b4a43cb68113b2f4d21a4f7c00803f192..dd0a89d383290e8dcab89e7c577e1c32adfc4fa4 100644 (file)
@@ -299,12 +299,15 @@ static int elogind_reboot(sd_bus *bus, enum elogind_action a) {
         }
 
         polkit_agent_open_if_enabled();
-        r = elogind_set_wall_message(bus, table[a]);
 
-        if (r < 0) {
-                log_warning_errno(r, "Failed to set wall message, ignoring: %s",
-                                  bus_error_message(&error, r));
-                sd_bus_error_free(&error);
+        if ( IN_SET(a, ACTION_POWEROFF, ACTION_REBOOT) ) {
+                r = elogind_set_wall_message(bus, table[a]);
+
+                if (r < 0) {
+                        log_warning_errno(r, "Failed to set wall message, ignoring: %s",
+                                          bus_error_message(&error, r));
+                        sd_bus_error_free(&error);
+                }
         }
 
         /* Now call elogind itself to request the operation */