git: 52a2b4bc5da2 - main - tests: Fix build if TIOCSTI is not defined
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 15 Jun 2026 15:43:23 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=52a2b4bc5da21d7a54cb16b9450196244b59b8c0
commit 52a2b4bc5da21d7a54cb16b9450196244b59b8c0
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-05-30 15:58:41 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-06-15 15:42:48 +0000
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
---
tests/sys/kern/tty/test_sti.c | 6 ++++++
1 file changed, 6 insertions(+)
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());
}