diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-16 23:00:51 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-16 23:00:51 +0100 |
commit | bb15969333d0476256c92edc068894a50d9159d4 (patch) | |
tree | 8be1ae084beadb0f10f25b62eaf9746f56a86256 | |
parent | 39646dce329c1b88b1de8ef0c450813765fda202 (diff) | |
download | busybox-w32-bb15969333d0476256c92edc068894a50d9159d4.tar.gz busybox-w32-bb15969333d0476256c92edc068894a50d9159d4.tar.bz2 busybox-w32-bb15969333d0476256c92edc068894a50d9159d4.zip |
libbb: do not compile selinux_or_die() if !SELINUX
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/xfuncs_printf.c | 6 |
1 files 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) | |||
523 | bb_simple_perror_msg_and_die(errmsg); | 523 | bb_simple_perror_msg_and_die(errmsg); |
524 | } | 524 | } |
525 | 525 | ||
526 | #if ENABLE_SELINUX | ||
526 | // selinux_or_die() - die if SELinux is disabled. | 527 | // selinux_or_die() - die if SELinux is disabled. |
527 | void FAST_FUNC selinux_or_die(void) | 528 | void FAST_FUNC selinux_or_die(void) |
528 | { | 529 | { |
529 | #if ENABLE_SELINUX | ||
530 | int rc = is_selinux_enabled(); | 530 | int rc = is_selinux_enabled(); |
531 | if (rc == 0) { | 531 | if (rc == 0) { |
532 | bb_simple_error_msg_and_die("SELinux is disabled"); | 532 | bb_simple_error_msg_and_die("SELinux is disabled"); |
533 | } else if (rc < 0) { | 533 | } else if (rc < 0) { |
534 | bb_simple_error_msg_and_die("is_selinux_enabled() failed"); | 534 | bb_simple_error_msg_and_die("is_selinux_enabled() failed"); |
535 | } | 535 | } |
536 | } | ||
536 | #else | 537 | #else |
537 | bb_simple_error_msg_and_die("SELinux support is disabled"); | 538 | /* not defined, other code must have no calls to it */ |
538 | #endif | 539 | #endif |
539 | } | ||
540 | 540 | ||
541 | int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) | 541 | int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) |
542 | { | 542 | { |