mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
selinux: add unlikely compiler hints for cache functions
This commit is contained in:
parent
b642dfcdc2
commit
c8aa389c42
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue