aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2025-05-30 15:58:41 +0000
committerEd Maste <emaste@FreeBSD.org>2026-06-15 15:42:48 +0000
commit52a2b4bc5da21d7a54cb16b9450196244b59b8c0 (patch)
treee750f15cdbc726fd09afd47650cb249b2f66e5fc
parent7f2d790824692b16ab2bf64a9b1e176f192cf319 (diff)
tests: Fix build if TIOCSTI is not defined
Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI We already have some components (such as mail and tcsh) that build without TIOCSTI defined. This is (existing portability support in those projects. Simplify things for downstreams by extending this approach to this additional TIOCSTI user. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50614
-rw-r--r--tests/sys/kern/tty/test_sti.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/sys/kern/tty/test_sti.c b/tests/sys/kern/tty/test_sti.c
index f792001b4e3f..d6ce05f76d81 100644
--- a/tests/sys/kern/tty/test_sti.c
+++ b/tests/sys/kern/tty/test_sti.c
@@ -19,6 +19,7 @@
#include <atf-c.h>
#include <libutil.h>
+#if defined(TIOCSTI)
enum stierr {
STIERR_CONFIG_FETCH,
STIERR_CONFIG,
@@ -325,13 +326,18 @@ ATF_TC_BODY(unprivileged_fail_noread, tc)
finalize_child(pid, -1);
}
+#endif /* defined(TIOCSTI) */
ATF_TP_ADD_TCS(tp)
{
+#if !defined(TIOCSTI)
+ (void)tp;
+#else
ATF_TP_ADD_TC(tp, basic);
ATF_TP_ADD_TC(tp, root);
ATF_TP_ADD_TC(tp, unprivileged_fail_noctty);
ATF_TP_ADD_TC(tp, unprivileged_fail_noread);
+#endif
return (atf_no_error());
}