From: Lennart Poettering Date: Wed, 21 Mar 2018 10:48:40 +0000 (+0100) Subject: selinux: let's fully (and statically) initialize log callback union (#8512) X-Git-Tag: v239~513 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2062ada74cd2124447aaf3cab9c854c3853146a0;p=thirdparty%2Fsystemd.git selinux: let's fully (and statically) initialize log callback union (#8512) We can make this const and static, and initialize this ahead of time and fully, hence let's do that. --- diff --git a/src/core/selinux-setup.c b/src/core/selinux-setup.c index 7135542106f..7b69b4c4c63 100644 --- a/src/core/selinux-setup.c +++ b/src/core/selinux-setup.c @@ -47,13 +47,15 @@ int mac_selinux_setup(bool *loaded_policy) { usec_t before_load, after_load; char *con; int r; - union selinux_callback cb; + static const union selinux_callback cb = { + .func_log = null_log, + }; + bool initialized = false; assert(loaded_policy); /* Turn off all of SELinux' own logging, we want to do that */ - cb.func_log = null_log; selinux_set_callback(SELINUX_CB_LOG, cb); /* Don't load policy in the initrd if we don't appear to have