diff --git a/test/test-tty.c b/test/test-tty.c index eb5d5df5..f3003efa 100644 --- a/test/test-tty.c +++ b/test/test-tty.c @@ -30,6 +30,9 @@ # include #endif +#include +#include + TEST_IMPL(tty) { int r, width, height; @@ -62,7 +65,12 @@ TEST_IMPL(tty) { #else /* unix */ ttyin_fd = open("/dev/tty", O_RDONLY, 0); + if (ttyin_fd < 0) + LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno)); + ttyout_fd = open("/dev/tty", O_WRONLY, 0); + if (ttyout_fd < 0) + LOGF("Cannot open /dev/tty as write-only: %s\n", strerror(errno)); #endif ASSERT(ttyin_fd >= 0);