chiark / gitweb /
journald: avoid logging to kmsg in the normal paths
[elogind.git] / src / journal / journald-kmsg.c
index cc0080da19e5663dbf0be9a0b81c1ae4a52f9e1f..284ace984d58f839731bce88f0c0d34a91e3d13f 100644 (file)
 #include <sys/epoll.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <sys/socket.h>
 
 #include <systemd/sd-messages.h>
 #include <libudev.h>
 
 #include "journald.h"
 #include "journald-kmsg.h"
+#include "journald-syslog.h"
 
 void server_forward_kmsg(
         Server *s,
@@ -273,7 +275,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
         if ((priority & LOG_FACMASK) == LOG_KERN)
                 IOVEC_SET_STRING(iovec[n++], "SYSLOG_IDENTIFIER=kernel");
         else {
-                syslog_read_identifier((const char**) &p, &identifier, &pid);
+                syslog_parse_identifier((const char**) &p, &identifier, &pid);
 
                 /* Avoid any messages we generated ourselves via
                  * log_info() and friends. */
@@ -357,7 +359,7 @@ int server_flush_dev_kmsg(Server *s) {
         if (!s->dev_kmsg_readable)
                 return 0;
 
-        log_info("Flushing /dev/kmsg...");
+        log_debug("Flushing /dev/kmsg...");
 
         for (;;) {
                 r = server_read_dev_kmsg(s);