test: add error logging to tty unit test
This commit is contained in:
parent
af6e865a07
commit
fe2a3150c0
@ -30,6 +30,9 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user