]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journald: remove pointless conditionalization
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2020 15:31:07 +0000 (16:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2020 13:12:26 +0000 (14:12 +0100)
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.

src/journal/journald-native.c
src/journal/journald-syslog.c

index f2b867da3d3cd5e1993157fe1217df3f8a2f4db9..fed81161e021fc3fbda26f0e8059f67b2155319d 100644 (file)
@@ -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)
index 0da7dcfcf56cffa3df510d8bf3ee3f5d053860bb..91ea41fa78af6039f4b68514244b42426c1249d8 100644 (file)
@@ -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)