chiark / gitweb /
tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)
[elogind.git] / src / login / logind-dbus.c
index 971b447a7cacef640fdac75a0eb4f59f59b4218c..d1eabdbf63a350623366ebfd6b413347c00d3463 100644 (file)
@@ -1446,7 +1446,7 @@ static int bus_manager_log_shutdown(
                 p = strjoina(p, " (", m->wall_message, ").");
 
         return log_struct(LOG_NOTICE,
-                          "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
+                          LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
                           p,
                           q,
                           NULL);
@@ -2464,9 +2464,13 @@ static int method_set_wall_message(
                 return 1; /* Will call us back */
 #endif // 0
 
-        r = free_and_strdup(&m->wall_message, empty_to_null(wall_message));
-        if (r < 0)
-                return log_oom();
+        if (isempty(wall_message))
+                m->wall_message = mfree(m->wall_message);
+        else {
+                r = free_and_strdup(&m->wall_message, wall_message);
+                if (r < 0)
+                        return log_oom();
+        }
 
         m->enable_wall_messages = enable_wall_messages;