#include "af-list.h"
#include "alloc-util.h"
-#include "def.h"
+#include "constants.h"
#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
-#include "journal-file.h"
#include "journal-remote-write.h"
#include "journal-remote.h"
#include "journald-native.h"
#include "macro.h"
+#include "managed-journal-file.h"
#include "parse-util.h"
#include "process-util.h"
#include "socket-util.h"
assert_not_reached();
}
- r = journal_file_open_reliably(filename,
- O_RDWR|O_CREAT, 0640,
- s->compress, UINT64_MAX, s->seal,
- &w->metrics,
- w->mmap, NULL,
- NULL, &w->journal);
+ r = managed_journal_file_open_reliably(
+ filename,
+ O_RDWR|O_CREAT,
+ s->file_flags,
+ 0640,
+ UINT64_MAX,
+ &w->metrics,
+ w->mmap,
+ NULL,
+ NULL,
+ &w->journal);
if (r < 0)
return log_error_errno(r, "Failed to open output journal %s: %m", filename);
- log_debug("Opened output file %s", w->journal->path);
+ log_debug("Opened output file %s", w->journal->file->path);
return 0;
}
const void *key;
int r;
- switch(s->split_mode) {
+ switch (s->split_mode) {
case JOURNAL_WRITE_SPLIT_NONE:
key = "one and only";
break;
if (r < 0)
return r;
- fd_ = -1;
+ fd_ = -EBADF;
s->active++;
return 0;
}
RemoteServer *s,
const char *output,
JournalWriteSplitMode split_mode,
- bool compress,
- bool seal) {
+ JournalFileFlags file_flags) {
int r;
journal_remote_server_global = s;
s->split_mode = split_mode;
- s->compress = compress;
- s->seal = seal;
+ s->file_flags = file_flags;
if (output)
s->output = output;
source = s->sources[fd];
assert(source->importer.fd == fd);
- r = process_source(source, s->compress, s->seal);
+ r = process_source(source, s->file_flags);
if (journal_importer_eof(&source->importer)) {
size_t remaining;
SocketAddress *addr,
char **hostname) {
- _cleanup_close_ int fd2 = -1;
+ _cleanup_close_ int fd2 = -EBADF;
int r;
log_debug("Accepting new %s connection on fd:%d", type, fd);
return log_error_errno(errno, "accept() on fd:%d failed: %m", fd);
}
- switch(socket_address_family(addr)) {
+ switch (socket_address_family(addr)) {
case AF_INET:
case AF_INET6: {
_cleanup_free_ char *a = NULL;