From f5796d2fbac47b026e3cc3f2b988a18c1d5b3f21 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 20 Nov 2015 15:04:55 -0500 Subject: [PATCH] test: fix test/test-tty.c for AIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '/dev/random' causes 'isatty()' to return 1 on AIX[1]. This causes an issue where 'dev/tty' is opened (hard coded in src/unix/tty.c:uv_tty_init). Tried to replace the hardcoded value with what is returned by 'ttyname()' but on AIX all that is returned is '/dev/'. This seems to be a bug with the AIX kernel. [1]http://goo.gl/wGa7mf PR-URL: https://github.com/libuv/libuv/pull/624 Reviewed-By: Ben Noordhuis Reviewed-By: Saúl Ibarra Corretgé --- test/test-tty.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test-tty.c b/test/test-tty.c index 81e612c1..b844959d 100644 --- a/test/test-tty.c +++ b/test/test-tty.c @@ -153,11 +153,14 @@ TEST_IMPL(tty_file) { ASSERT(0 == close(fd)); } +/* Bug on AIX where '/dev/random' returns 1 from isatty() */ +#ifndef _AIX fd = open("/dev/random", O_RDONLY); if (fd != -1) { ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); ASSERT(0 == close(fd)); } +#endif /* _AIX */ fd = open("/dev/zero", O_RDONLY); if (fd != -1) {