From ec10a787713fc2c2a6c9a5af6612314d569bfde9 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Sat, 12 Jan 2019 10:25:30 +0100 Subject: [PATCH] win, tty: fix CreateFileW() return value check CreateFileW() returns INVALID_HANDLE_VALUE on failure, not NULL. Fixes: https://github.com/libuv/libuv/issues/2141 PR-URL: https://github.com/libuv/libuv/pull/2142 Reviewed-By: Colin Ihrig --- src/win/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/tty.c b/src/win/tty.c index d058ef66de6..ef4efd2ad64 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -164,7 +164,7 @@ void uv_console_init(void) { OPEN_EXISTING, 0, 0); - if (uv__tty_console_handle != NULL) { + if (uv__tty_console_handle != INVALID_HANDLE_VALUE) { QueueUserWorkItem(uv__tty_console_resize_message_loop_thread, NULL, WT_EXECUTELONGFUNCTION);