From c5df8c2323940958efc84d4bfb3cd253591c1a45 Mon Sep 17 00:00:00 2001 From: Ivan Kruglov Date: Tue, 29 Jul 2025 22:56:41 +0200 Subject: [PATCH] core: merging errno usage in access_init() --- src/core/selinux-access.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c index fe4d8a15075..e5584df9a76 100644 --- a/src/core/selinux-access.c +++ b/src/core/selinux-access.c @@ -154,9 +154,8 @@ static int access_init(sd_bus_error *error) { return 1; if (avc_open(NULL, 0) != 0) { - r = -errno; /* Save original errno for later */ - - r = log_selinux_enforcing_errno(r, "Failed to open the SELinux AVC: %m"); + /* Passing errno to save original value for later */ + r = log_selinux_enforcing_errno(errno, "Failed to open the SELinux AVC: %m"); if (r == 0) /* log_selinux_enforcing_errno() can return 0 if the enforcement isn't on. * In this case don't do any AVC checks. -- 2.47.3