chiark / gitweb /
macro: rework how we define cleanup macros
[elogind.git] / src / journal / journald-kmsg.c
index 86786cef551fdfa4d6628f264ad3837ce4374bbb..2f536320f8d90d41a8eff6740a55da8051ed83a7 100644 (file)
@@ -28,7 +28,7 @@
 #include <systemd/sd-messages.h>
 #include <libudev.h>
 
-#include "journald.h"
+#include "journald-server.h"
 #include "journald-kmsg.h"
 #include "journald-syslog.h"
 
@@ -250,10 +250,12 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
                                         break;
 
                                 g = udev_list_entry_get_name(ll);
-                                b = strappend("_UDEV_DEVLINK=", g);
                                 if (g) {
-                                        IOVEC_SET_STRING(iovec[n++], b);
-                                        z++;
+                                        b = strappend("_UDEV_DEVLINK=", g);
+                                        if (b) {
+                                                IOVEC_SET_STRING(iovec[n++], b);
+                                                z++;
+                                        }
                                 }
 
                                 j++;