From: Zbigniew Jędrzejewski-Szmek Date: Wed, 16 May 2018 09:36:52 +0000 (+0200) Subject: journal-remote: export handle_raw_source() X-Git-Tag: v239~172^2~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=864876ec0f1cd9f8585bc0b541d34b0f2b583d09;p=thirdparty%2Fsystemd.git journal-remote: export handle_raw_source() --- diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 9e9fe91786f..15e855bc8b6 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -378,10 +378,11 @@ RemoteServer* journal_remote_server_destroy(RemoteServer *s) { ********************************************************************** **********************************************************************/ -static int handle_raw_source(sd_event_source *event, - int fd, - uint32_t revents, - RemoteServer *s) { +int journal_remote_handle_raw_source( + sd_event_source *event, + int fd, + uint32_t revents, + RemoteServer *s) { RemoteSource *source; int r; @@ -428,7 +429,7 @@ static int dispatch_raw_source_until_block(sd_event_source *event, /* Make sure event stays around even if source is destroyed */ sd_event_source_ref(event); - r = handle_raw_source(event, source->importer.fd, EPOLLIN, journal_remote_server_global); + r = journal_remote_handle_raw_source(event, source->importer.fd, EPOLLIN, journal_remote_server_global); if (r != 1) /* No more data for now */ sd_event_source_set_enabled(event, SD_EVENT_OFF); @@ -448,7 +449,7 @@ static int dispatch_raw_source_event(sd_event_source *event, assert(source->event); assert(source->buffer_event); - r = handle_raw_source(event, fd, EPOLLIN, journal_remote_server_global); + r = journal_remote_handle_raw_source(event, fd, EPOLLIN, journal_remote_server_global); if (r == 1) /* Might have more data. We need to rerun the handler * until we are sure the buffer is exhausted. */ @@ -461,7 +462,7 @@ static int dispatch_blocking_source_event(sd_event_source *event, void *userdata) { RemoteSource *source = userdata; - return handle_raw_source(event, source->importer.fd, EPOLLIN, journal_remote_server_global); + return journal_remote_handle_raw_source(event, source->importer.fd, EPOLLIN, journal_remote_server_global); } static int accept_connection(const char* type, int fd, diff --git a/src/journal-remote/journal-remote.h b/src/journal-remote/journal-remote.h index 72741c7fbad..d4e068dad8f 100644 --- a/src/journal-remote/journal-remote.h +++ b/src/journal-remote/journal-remote.h @@ -58,5 +58,10 @@ int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer int journal_remote_add_source(RemoteServer *s, int fd, char* name, bool own_name); int journal_remote_add_raw_socket(RemoteServer *s, int fd); +int journal_remote_handle_raw_source( + sd_event_source *event, + int fd, + uint32_t revents, + RemoteServer *s); RemoteServer* journal_remote_server_destroy(RemoteServer *s);