summaryrefslogtreecommitdiffstats
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-02-16 15:29:29 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-02-19 11:56:28 +0100
commit8f9e3ea0907e82440869d8054ec02f527caa6614 (patch)
treecbdfcc378a5c772a8b05a4676bd33617ab81e72f /src/journal/journald-server.c
parentMerge pull request #31218 from CodethinkLabs/vmspawn/journal_forwarding (diff)
downloadsystemd-8f9e3ea0907e82440869d8054ec02f527caa6614.tar.xz
systemd-8f9e3ea0907e82440869d8054ec02f527caa6614.zip
journald: shorten code a bit and return error where it's useful
Follow-up for f31cff849d3db074d0d8157e4117d9b8372c03e8.
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 6bcc37a8ab..a8c186dc20 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1155,7 +1155,7 @@ static void server_dispatch_message_real(
else
journal_uid = 0;
- server_forward_socket(s, iovec, n, priority);
+ (void) server_forward_socket(s, iovec, n, priority);
server_write_to_journal(s, journal_uid, iovec, n, priority);
}
@@ -2488,16 +2488,12 @@ static void server_load_credentials(Server *s) {
assert(s);
/* if we already have a forward address from config don't load the credential */
- if (s->forward_to_socket.sockaddr.sa.sa_family != AF_UNSPEC) {
- log_debug("Socket forward address already set not loading journal.forward_to_socket");
- return;
- }
+ if (s->forward_to_socket.sockaddr.sa.sa_family != AF_UNSPEC)
+ return log_debug("Socket forward address already set not loading journal.forward_to_socket");
r = read_credential("journal.forward_to_socket", &data, NULL);
- if (r < 0) {
- log_debug_errno(r, "Failed to read credential journal.forward_to_socket, ignoring: %m");
- return;
- }
+ if (r < 0)
+ return (void) log_debug_errno(r, "Failed to read credential journal.forward_to_socket, ignoring: %m");
r = socket_address_parse(&s->forward_to_socket, data);
if (r < 0)