From: Christian Göttsche Date: Thu, 26 Mar 2020 19:15:08 +0000 (+0100) Subject: selinux: add unlikely compiler hints for cache functions X-Git-Tag: v246-rc1~693^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8aa389c42bf365109f46cca07f8a1f3851fd61f;p=thirdparty%2Fsystemd.git selinux: add unlikely compiler hints for cache functions --- diff --git a/src/basic/selinux-util.c b/src/basic/selinux-util.c index 2d5e750ea56..0484ba0adb7 100644 --- a/src/basic/selinux-util.c +++ b/src/basic/selinux-util.c @@ -44,7 +44,7 @@ static struct selabel_handle *label_hnd = NULL; bool mac_selinux_use(void) { #if HAVE_SELINUX - if (cached_use < 0) + if (_unlikely_(cached_use < 0)) cached_use = is_selinux_enabled() > 0; return cached_use; @@ -55,7 +55,7 @@ bool mac_selinux_use(void) { bool mac_selinux_enforcing(void) { #if HAVE_SELINUX - if (cached_enforcing < 0) { + if (_unlikely_(cached_enforcing < 0)) { cached_enforcing = security_getenforce(); if (cached_enforcing == -1) { log_error_errno(errno, "Failed to get SELinux enforced status: %m");