summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-upload.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
commitfc53809803cd2bc2434e312b19a18fa36776da12 (patch)
treeb4b43bd6538f51965ce32856e9c053d0f90919c8 /src/journal-remote/journal-upload.c
parentAdding upstream version 255.5. (diff)
downloadsystemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz
systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/journal-remote/journal-upload.c')
-rw-r--r--src/journal-remote/journal-upload.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index d70a049..f6b9351 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -366,7 +366,7 @@ static int open_file_for_upload(Uploader *u, const char *filename) {
u->input = fd;
if (arg_follow != 0) {
- r = sd_event_add_io(u->events, &u->input_event,
+ r = sd_event_add_io(u->event, &u->input_event,
fd, EPOLLIN, dispatch_fd_input, u);
if (r < 0) {
if (r != -EPERM || arg_follow > 0)
@@ -415,11 +415,11 @@ static int setup_uploader(Uploader *u, const char *url, const char *state_file)
u->state_file = state_file;
- r = sd_event_default(&u->events);
+ r = sd_event_default(&u->event);
if (r < 0)
return log_error_errno(r, "sd_event_default failed: %m");
- r = sd_event_set_signal_exit(u->events, true);
+ r = sd_event_set_signal_exit(u->event, true);
if (r < 0)
return log_error_errno(r, "Failed to install SIGINT/SIGTERM handlers: %m");
@@ -445,7 +445,7 @@ static void destroy_uploader(Uploader *u) {
close_fd_input(u);
close_journal_input(u);
- sd_event_unref(u->events);
+ sd_event_unref(u->event);
}
static int perform_upload(Uploader *u) {
@@ -499,9 +499,12 @@ static int parse_config(void) {
{}
};
- return config_parse_config_file("journal-upload.conf", "Upload\0",
- config_item_table_lookup, items,
- CONFIG_PARSE_WARN, NULL);
+ return config_parse_standard_file_with_dropins(
+ "systemd/journal-upload.conf",
+ "Upload\0",
+ config_item_table_lookup, items,
+ CONFIG_PARSE_WARN,
+ /* userdata= */ NULL);
}
static int help(void) {
@@ -745,7 +748,7 @@ static int open_journal(sd_journal **j) {
else if (arg_file)
r = sd_journal_open_files(j, (const char**) arg_file, 0);
else if (arg_machine)
- r = journal_open_machine(j, arg_machine);
+ r = journal_open_machine(j, arg_machine, 0);
else
r = sd_journal_open_namespace(j, arg_namespace,
(arg_merge ? 0 : SD_JOURNAL_LOCAL_ONLY) | arg_namespace_flags | arg_journal_type);
@@ -761,8 +764,7 @@ static int run(int argc, char **argv) {
bool use_journal;
int r;
- log_show_color(true);
- log_parse_environment();
+ log_setup();
/* The journal merging logic potentially needs a lot of fds. */
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
@@ -781,7 +783,7 @@ static int run(int argc, char **argv) {
if (r < 0)
return r;
- sd_event_set_watchdog(u.events, true);
+ sd_event_set_watchdog(u.event, true);
r = check_cursor_updating(&u);
if (r < 0)
@@ -809,7 +811,7 @@ static int run(int argc, char **argv) {
NOTIFY_STOPPING);
for (;;) {
- r = sd_event_get_state(u.events);
+ r = sd_event_get_state(u.event);
if (r < 0)
return r;
if (r == SD_EVENT_FINISHED)
@@ -836,7 +838,7 @@ static int run(int argc, char **argv) {
return r;
}
- r = sd_event_run(u.events, u.timeout);
+ r = sd_event_run(u.event, u.timeout);
if (r < 0)
return log_error_errno(r, "Failed to run event loop: %m");
}