chiark / gitweb /
tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID
[elogind.git] / src / login / logind-dbus.c
index 26b6c3a92368445f85cdbac946bcf6be79be1e45..971b447a7cacef640fdac75a0eb4f59f59b4218c 100644 (file)
@@ -34,7 +34,7 @@
 #include "escape.h"
 #include "fd-util.h"
 #include "fileio-label.h"
-#include "formats-util.h"
+#include "format-util.h"
 #include "fs-util.h"
 #include "logind.h"
 #include "mkdir.h"
@@ -1301,8 +1301,7 @@ static int flush_devices(Manager *m) {
         } else {
                 struct dirent *de;
 
-                while ((de = readdir(d))) {
-
+                FOREACH_DIRENT_ALL(de, d, break) {
                         if (!dirent_is_file(de))
                                 continue;
 
@@ -1447,7 +1446,7 @@ static int bus_manager_log_shutdown(
                 p = strjoina(p, " (", m->wall_message, ").");
 
         return log_struct(LOG_NOTICE,
-                          LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                          "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                           p,
                           q,
                           NULL);
@@ -2465,13 +2464,9 @@ static int method_set_wall_message(
                 return 1; /* Will call us back */
 #endif // 0
 
-        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();
-        }
+        r = free_and_strdup(&m->wall_message, empty_to_null(wall_message));
+        if (r < 0)
+                return log_oom();
 
         m->enable_wall_messages = enable_wall_messages;