diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/journal-remote/journal-remote-main.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-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-remote-main.c')
-rw-r--r-- | src/journal-remote/journal-remote-main.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index 294719b..34d4062 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -108,7 +108,7 @@ static int spawn_child(const char* child, char** argv) { r = fd_nonblock(fd[0], true); if (r < 0) - log_warning_errno(errno, "Failed to set child pipe to non-blocking: %m"); + log_warning_errno(r, "Failed to set child pipe to non-blocking: %m"); return fd[0]; } @@ -374,7 +374,7 @@ static int setup_microhttpd_server(RemoteServer *s, { MHD_OPTION_EXTERNAL_LOGGER, (intptr_t) microhttpd_logger}, { MHD_OPTION_NOTIFY_COMPLETED, (intptr_t) request_meta_free}, { MHD_OPTION_LISTEN_SOCKET, fd}, - { MHD_OPTION_CONNECTION_MEMORY_LIMIT, 128*1024}, + { MHD_OPTION_CONNECTION_MEMORY_LIMIT, JOURNAL_SERVER_MEMORY_MAX}, { MHD_OPTION_END}, { MHD_OPTION_END}, { MHD_OPTION_END}, @@ -451,7 +451,7 @@ static int setup_microhttpd_server(RemoteServer *s, if (epoll_fd < 0) return log_error_errno(SYNTHETIC_ERRNO(EUCLEAN), "μhttp epoll fd is invalid"); - r = sd_event_add_io(s->events, &d->io_event, + r = sd_event_add_io(s->event, &d->io_event, epoll_fd, EPOLLIN, dispatch_http_event, d); if (r < 0) @@ -461,7 +461,7 @@ static int setup_microhttpd_server(RemoteServer *s, if (r < 0) return log_error_errno(r, "Failed to set source name: %m"); - r = sd_event_add_time(s->events, &d->timer_event, + r = sd_event_add_time(s->event, &d->timer_event, CLOCK_MONOTONIC, UINT64_MAX, 0, null_timer_event_handler, d); if (r < 0) @@ -562,7 +562,7 @@ static int create_remoteserver( if (r < 0) return r; - r = sd_event_set_signal_exit(s->events, true); + r = sd_event_set_signal_exit(s->event, true); if (r < 0) return log_error_errno(r, "Failed to install SIGINT/SIGTERM handlers: %m"); @@ -728,9 +728,12 @@ static int parse_config(void) { {} }; - return config_parse_config_file("journal-remote.conf", "Remote\0", - config_item_table_lookup, items, - CONFIG_PARSE_WARN, NULL); + return config_parse_standard_file_with_dropins( + "systemd/journal-remote.conf", + "Remote\0", + config_item_table_lookup, items, + CONFIG_PARSE_WARN, + /* userdata= */ NULL); } static int help(void) { @@ -1067,8 +1070,7 @@ static int run(int argc, char **argv) { _cleanup_free_ char *cert = NULL, *trust = NULL; 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); @@ -1107,7 +1109,7 @@ static int run(int argc, char **argv) { if (r < 0) return r; - r = sd_event_set_watchdog(s.events, true); + r = sd_event_set_watchdog(s.event, true); if (r < 0) return log_error_errno(r, "Failed to enable watchdog: %m"); @@ -1119,13 +1121,13 @@ static int run(int argc, char **argv) { notify_message = notify_start(NOTIFY_READY, NOTIFY_STOPPING); while (s.active) { - r = sd_event_get_state(s.events); + r = sd_event_get_state(s.event); if (r < 0) return r; if (r == SD_EVENT_FINISHED) break; - r = sd_event_run(s.events, -1); + r = sd_event_run(s.event, -1); if (r < 0) return log_error_errno(r, "Failed to run event loop: %m"); } |