source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)],
boot_id[sizeof("_BOOT_ID=") + 32] = "_BOOT_ID=",
machine_id[sizeof("_MACHINE_ID=") + 32] = "_MACHINE_ID=";
- char *comm, *exe, *cmdline, *cgroup, *session, *unit, *selinux_context, *hostname;
+ char *comm, *exe, *cmdline, *cgroup, *session, *unit, *hostname;
sd_id128_t id;
int r;
char *t, *c;
#ifdef HAVE_SELINUX
if (label) {
- selinux_context = alloca(sizeof("_SELINUX_CONTEXT=") + label_len);
+ char *selinux_context = alloca(sizeof("_SELINUX_CONTEXT=") + label_len);
*((char*) mempcpy(stpcpy(selinux_context, "_SELINUX_CONTEXT="), label, label_len)) = 0;
IOVEC_SET_STRING(iovec[n++], selinux_context);
security_context_t con;
if (getpidcon(ucred->pid, &con) >= 0) {
- selinux_context = strappenda("_SELINUX_CONTEXT=", con);
+ char *selinux_context = strappenda("_SELINUX_CONTEXT=", con);
+
freecon(con);
IOVEC_SET_STRING(iovec[n++], selinux_context);
}
server_rotate(s);
server_vacuum(s);
+ if (!s->system_journal) {
+ log_notice("Didn't flush runtime journal since rotation of system journal wasn't successful.");
+ r = -EIO;
+ goto finish;
+ }
+
log_debug("Retrying write.");
r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL);
if (r < 0) {
}
static int server_parse_config_file(Server *s) {
- static const char *fn = "/etc/systemd/journald.conf";
+ static const char fn[] = "/etc/systemd/journald.conf";
_cleanup_fclose_ FILE *f = NULL;
int r;
}
r = config_parse(NULL, fn, f, "Journal\0", config_item_perf_lookup,
- (void*) journald_gperf_lookup, false, s);
+ (void*) journald_gperf_lookup, false, false, s);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));