diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-04-11 09:58:58 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-04-11 10:01:56 +0200 |
commit | b50e9011d0199f3ff7d58eca1ed5f23289a16442 (patch) | |
tree | 272243c3db841463167d822ea41c70e7c52762cf /src/journal-remote | |
parent | journal-remote: Use sd_event_set_signal_exit() (diff) | |
download | systemd-b50e9011d0199f3ff7d58eca1ed5f23289a16442.tar.xz systemd-b50e9011d0199f3ff7d58eca1ed5f23289a16442.zip |
journal-remote: Use "event" instead of "events"
We use singular "event" everywhere else, so let's use it here as well.
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/journal-remote-main.c | 12 | ||||
-rw-r--r-- | src/journal-remote/journal-remote.c | 12 | ||||
-rw-r--r-- | src/journal-remote/journal-remote.h | 2 | ||||
-rw-r--r-- | src/journal-remote/journal-upload-journal.c | 2 | ||||
-rw-r--r-- | src/journal-remote/journal-upload.c | 14 | ||||
-rw-r--r-- | src/journal-remote/journal-upload.h | 2 |
6 files changed, 22 insertions, 22 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index 64677035d3..545a1c6240 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -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"); @@ -1110,7 +1110,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"); @@ -1122,13 +1122,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"); } diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 66f1fb1934..92187b7420 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -257,19 +257,19 @@ int journal_remote_add_source(RemoteServer *s, int fd, char* name, bool own_name return r; } - r = sd_event_add_io(s->events, &source->event, + r = sd_event_add_io(s->event, &source->event, fd, EPOLLIN|EPOLLRDHUP|EPOLLPRI, dispatch_raw_source_event, source); if (r == 0) { /* Add additional source for buffer processing. It will be * enabled later. */ - r = sd_event_add_defer(s->events, &source->buffer_event, + r = sd_event_add_defer(s->event, &source->buffer_event, dispatch_raw_source_until_block, source); if (r == 0) r = sd_event_source_set_enabled(source->buffer_event, SD_EVENT_OFF); } else if (r == -EPERM) { log_debug("Falling back to sd_event_add_defer for fd:%d (%s)", fd, name); - r = sd_event_add_defer(s->events, &source->event, + r = sd_event_add_defer(s->event, &source->event, dispatch_blocking_source_event, source); if (r == 0) r = sd_event_source_set_enabled(source->event, SD_EVENT_ON); @@ -301,7 +301,7 @@ int journal_remote_add_raw_socket(RemoteServer *s, int fd) { assert(s); assert(fd >= 0); - r = sd_event_add_io(s->events, &s->listen_event, + r = sd_event_add_io(s->event, &s->listen_event, fd, EPOLLIN, dispatch_raw_connection_event, s); if (r < 0) @@ -347,7 +347,7 @@ int journal_remote_server_init( else assert_not_reached(); - r = sd_event_default(&s->events); + r = sd_event_default(&s->event); if (r < 0) return log_error_errno(r, "Failed to allocate event loop: %m"); @@ -376,7 +376,7 @@ void journal_remote_server_destroy(RemoteServer *s) { hashmap_free(s->writers); sd_event_source_unref(s->listen_event); - sd_event_unref(s->events); + sd_event_unref(s->event); if (s == journal_remote_server_global) journal_remote_server_global = NULL; diff --git a/src/journal-remote/journal-remote.h b/src/journal-remote/journal-remote.h index c5da6fa688..f1ec5d9a54 100644 --- a/src/journal-remote/journal-remote.h +++ b/src/journal-remote/journal-remote.h @@ -29,7 +29,7 @@ struct RemoteServer { RemoteSource **sources; size_t active; - sd_event *events; + sd_event *event; sd_event_source *listen_event; Hashmap *writers; diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c index 8206ca89bf..23ad3b2d31 100644 --- a/src/journal-remote/journal-upload-journal.c +++ b/src/journal-remote/journal-upload-journal.c @@ -388,7 +388,7 @@ int open_journal_for_upload(Uploader *u, else u->timeout = JOURNAL_UPLOAD_POLL_TIMEOUT; - r = sd_event_add_io(u->events, &u->input_event, + r = sd_event_add_io(u->event, &u->input_event, fd, events, dispatch_journal_input, u); if (r < 0) return log_error_errno(r, "Failed to register input event: %m"); diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 3ce730ce27..34f2e1b253 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -364,7 +364,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) @@ -413,11 +413,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"); @@ -443,7 +443,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) { @@ -782,7 +782,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) @@ -810,7 +810,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) @@ -837,7 +837,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"); } diff --git a/src/journal-remote/journal-upload.h b/src/journal-remote/journal-upload.h index 200786413f..5ba3c4f1a0 100644 --- a/src/journal-remote/journal-upload.h +++ b/src/journal-remote/journal-upload.h @@ -24,7 +24,7 @@ typedef enum { } entry_state; typedef struct Uploader { - sd_event *events; + sd_event *event; char *url; CURL *easy; |