]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: merging errno usage in access_init()
authorIvan Kruglov <mail@ikruglov.com>
Tue, 29 Jul 2025 20:56:41 +0000 (22:56 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Jul 2025 23:25:58 +0000 (08:25 +0900)
src/core/selinux-access.c

index fe4d8a15075efcaa62761bd49b2e8805ae0bf042..e5584df9a763ef67fc7f279d21c2f781e06f3848 100644 (file)
@@ -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.