chiark / gitweb /
log: fix order of log_unit_struct() to match other logging calls
[elogind.git] / src / journal / journald-server.c
index e06242769e7acc2142b40cad4f7b068d336deac9..4fd2069d81a3b7bb696d4812b9ddb5bf6fc98b61 100644 (file)
@@ -375,7 +375,7 @@ static void do_vacuum(Server *s, char *ids, JournalFile *f, const char* path,
                 return;
 
         p = strappenda(path, ids);
-        r = journal_directory_vacuum(p, metrics->max_use, s->max_retention_usec, &s->oldest_file_usec);
+        r = journal_directory_vacuum(p, metrics->max_use, s->max_retention_usec, &s->oldest_file_usec, false);
         if (r < 0 && r != -ENOENT)
                 log_error("Failed to vacuum %s: %s", p, strerror(-r));
 }
@@ -841,7 +841,7 @@ void server_driver_message(Server *s, sd_id128_t message_id, const char *format,
         IOVEC_SET_STRING(iovec[n++], buffer);
 
         if (!sd_id128_equal(message_id, SD_ID128_NULL)) {
-                snprintf(mid, sizeof(mid), MESSAGE_ID(message_id));
+                snprintf(mid, sizeof(mid), LOG_MESSAGE_ID(message_id));
                 char_array_0(mid);
                 IOVEC_SET_STRING(iovec[n++], mid);
         }
@@ -1226,7 +1226,7 @@ int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userda
                         assert(fd == s->audit_fd);
 
                         if (n > 0 && n_fds == 0)
-                                server_process_audit_message(s, s->buffer, n, ucred, tv, &sa, msghdr.msg_namelen);
+                                server_process_audit_message(s, s->buffer, n, ucred, &sa, msghdr.msg_namelen);
                         else if (n_fds > 0)
                                 log_warning("Got file descriptors via audit socket. Ignoring.");
                 }
@@ -1310,10 +1310,10 @@ static int server_parse_proc_cmdline(Server *s) {
         int r;
 
         r = proc_cmdline(&line);
-        if (r < 0)
+        if (r < 0) {
                 log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
-        if (r <= 0)
                 return 0;
+        }
 
         FOREACH_WORD_QUOTED(w, l, line, state) {
                 _cleanup_free_ char *word;
@@ -1566,10 +1566,8 @@ int server_init(Server *s) {
 
                         s->audit_fd = fd;
 
-                } else {
-                        log_error("Unknown socket passed.");
-                        return -EINVAL;
-                }
+                } else
+                        log_error("Unknown socket passed as file descriptor %d, ignoring.", fd);
         }
 
         r = server_open_syslog_socket(s);
@@ -1690,6 +1688,7 @@ void server_done(Server *s) {
         free(s->buffer);
         free(s->tty_path);
         free(s->cgroup_root);
+        free(s->hostname_field);
 
         if (s->mmap)
                 mmap_cache_unref(s->mmap);