From: Daan De Meyer Date: Fri, 20 Mar 2026 20:38:27 +0000 (+0100) Subject: selinux-util: Make clang-tidy happy if selinux is not available X-Git-Tag: v261-rc1~763^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ae78f0ca92a0843bf67616c2e7d6c6c8f4818d7;p=thirdparty%2Fsystemd.git selinux-util: Make clang-tidy happy if selinux is not available Most of our libraries are available on all distributions so we don't bother with making clang-tidy happy if the library is not available. The one exception is selinux which isn't available on Arch. Let's conditionalize the includes in selinux-util.c so that clang-tidy is still happy on Arch where we can't install libselinux. --- diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c index f980ec83acb..1049044f87b 100644 --- a/src/shared/selinux-util.c +++ b/src/shared/selinux-util.c @@ -1,32 +1,34 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include -#include -#include #include #include -#include #include #if HAVE_SELINUX +#include +#include +#include + #include #include #include #include -#endif #include "sd-dlopen.h" #include "alloc-util.h" -#include "errno-util.h" #include "fd-util.h" #include "label.h" -#include "label-util.h" #include "log.h" #include "path-util.h" -#include "selinux-util.h" #include "string-util.h" #include "time-util.h" +#endif + +#include "errno-util.h" +#include "label-util.h" +#include "selinux-util.h" #if HAVE_SELINUX DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(context_t, sym_context_free, context_freep, NULL);