From: Lennart Poettering Date: Mon, 26 Oct 2020 15:31:07 +0000 (+0100) Subject: journald: remove pointless conditionalization X-Git-Tag: v247-rc2~50^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b719003c386c8e93f31eb98b8cc5bcd6941822f;p=thirdparty%2Fsystemd.git journald: remove pointless conditionalization Let's not have #ifdeffery both in the consumers and the providers of the selinux glue code. Unless the code is particularly complex, let's do the ifdeffery only in the provider of the selinux glue code, and let's keep the consumers simple and just invoke it. --- diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index f2b867da3d3..fed81161e02 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -483,13 +483,11 @@ int server_open_native_socket(Server *s, const char *native_socket) { if (r < 0) return log_error_errno(r, "SO_PASSCRED failed: %m"); -#if HAVE_SELINUX if (mac_selinux_use()) { r = setsockopt_int(s->native_fd, SOL_SOCKET, SO_PASSSEC, true); if (r < 0) log_warning_errno(r, "SO_PASSSEC failed: %m"); } -#endif r = setsockopt_int(s->native_fd, SOL_SOCKET, SO_TIMESTAMP, true); if (r < 0) diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 0da7dcfcf56..91ea41fa78a 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -70,9 +70,8 @@ static void forward_syslog_iovec( msghdr.msg_controllen = cmsg->cmsg_len; } - /* Forward the syslog message we received via /dev/log to - * /run/systemd/syslog. Unfortunately we currently can't set - * the SO_TIMESTAMP auxiliary data, and hence we don't. */ + /* Forward the syslog message we received via /dev/log to /run/systemd/syslog. Unfortunately we + * currently can't set the SO_TIMESTAMP auxiliary data, and hence we don't. */ if (sendmsg(s->syslog_fd, &msghdr, MSG_NOSIGNAL) >= 0) return; @@ -484,13 +483,11 @@ int server_open_syslog_socket(Server *s, const char *syslog_socket) { if (r < 0) return log_error_errno(r, "SO_PASSCRED failed: %m"); -#if HAVE_SELINUX if (mac_selinux_use()) { r = setsockopt_int(s->syslog_fd, SOL_SOCKET, SO_PASSSEC, true); if (r < 0) log_warning_errno(r, "SO_PASSSEC failed: %m"); } -#endif r = setsockopt_int(s->syslog_fd, SOL_SOCKET, SO_TIMESTAMP, true); if (r < 0)