test: fix tty_file, close handle if initialized
If the handle is closed when it wasn't initialized, uv_close will fail. PR-URL: https://github.com/libuv/libuv/pull/279 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
12c93608d0
commit
34da61b351
@ -167,9 +167,9 @@ TEST_IMPL(tty_file) {
|
||||
if (fd != -1) {
|
||||
ASSERT(0 == uv_tty_init(&loop, &tty, fd, 1));
|
||||
ASSERT(0 == close(fd));
|
||||
uv_close((uv_handle_t*) &tty, NULL);
|
||||
}
|
||||
|
||||
uv_close((uv_handle_t*) &tty, NULL);
|
||||
ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT));
|
||||
ASSERT(0 == uv_loop_close(&loop));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user