From 4878e8284f5f983968de188d6d740bd3f6ac0e2f Mon Sep 17 00:00:00 2001 From: Kevin Adler Date: Wed, 25 Mar 2020 10:41:28 -0500 Subject: [PATCH] test: Test EBADF tty handling PR-URL: https://github.com/libuv/libuv/pull/2753 Reviewed-By: Ben Noordhuis Reviewed-By: Richard Lau --- test/test-tty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test-tty.c b/test/test-tty.c index 688711e5..0c6548f9 100644 --- a/test/test-tty.c +++ b/test/test-tty.c @@ -360,6 +360,8 @@ TEST_IMPL(tty_file) { if (fd != -1) { ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); ASSERT(0 == close(fd)); + /* test EBADF handling */ + ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); } /* Bug on AIX where '/dev/random' returns 1 from isatty() */