[git commit] libbb: do not compile selinux_or_die() if !SELINUX

Denys Vlasenko vda.linux at googlemail.com
Wed Dec 16 22:00:51 UTC 2020


commit: https://git.busybox.net/busybox/commit/?id=bb15969333d0476256c92edc068894a50d9159d4
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/xfuncs_printf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 6c220434d..aea995a5c 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -523,20 +523,20 @@ void FAST_FUNC xfstat(int fd, struct stat *stat_buf, const char *errmsg)
 		bb_simple_perror_msg_and_die(errmsg);
 }
 
+#if ENABLE_SELINUX
 // selinux_or_die() - die if SELinux is disabled.
 void FAST_FUNC selinux_or_die(void)
 {
-#if ENABLE_SELINUX
 	int rc = is_selinux_enabled();
 	if (rc == 0) {
 		bb_simple_error_msg_and_die("SELinux is disabled");
 	} else if (rc < 0) {
 		bb_simple_error_msg_and_die("is_selinux_enabled() failed");
 	}
+}
 #else
-	bb_simple_error_msg_and_die("SELinux support is disabled");
+/* not defined, other code must have no calls to it */
 #endif
-}
 
 int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
 {


More information about the busybox-cvs mailing list