X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fima-setup.c;h=ed65096f043a9379ac8b58a46f5bd19693777cf7;hp=e8cc1ba8b6cb451775e06d189dd46c9a91d99193;hb=03e334a1c7dc8c20c38902aa039440763acc9b17;hpb=5430f7f2bc7330f3088b894166bf3524a067e3d8 diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c index e8cc1ba8b..ed65096f0 100644 --- a/src/core/ima-setup.c +++ b/src/core/ima-setup.c @@ -47,14 +47,9 @@ int ima_setup(void) { struct stat st; ssize_t policy_size = 0, written = 0; char *policy; - int policyfd = -1, imafd = -1; + _cleanup_close_ int policyfd = -1, imafd = -1; int result = 0; -#ifndef HAVE_SELINUX - /* Mount the securityfs filesystem */ - mount_setup_early(); -#endif - if (stat(IMA_POLICY_PATH, &st) < 0) return 0; @@ -103,10 +98,6 @@ int ima_setup(void) { out_mmap: munmap(policy, policy_size); out: - if (policyfd >= 0) - close_nointr_nofail(policyfd); - if (imafd >= 0) - close_nointr_nofail(imafd); if (result) return result; #endif /* HAVE_IMA */