-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
Previously, we required the user to specify the expected read/write flags for a pipe or tty. But we've already been asking the OS to tell us what they actually are (fcntl F_GETFL), so we can hopefully just use that information directly. Fixes: #1936 PR-URL: #1964 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,9 +172,12 @@ void uv_console_init(void) { | |
} | ||
|
||
|
||
int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { | ||
int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int unused) { | ||
BOOL readable; | ||
DWORD NumberOfEvents; | ||
HANDLE handle; | ||
CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info; | ||
(void)unused; | ||
|
||
uv__once_init(); | ||
handle = (HANDLE) uv__get_osfhandle(fd); | ||
|
@@ -199,6 +202,7 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { | |
fd = -1; | ||
} | ||
|
||
readable = GetNumberOfConsoleInputEvents(handle, &NumberOfEvents); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vtjnash
Author
Member
|
||
if (!readable) { | ||
/* Obtain the screen buffer info with the output handle. */ | ||
if (!GetConsoleScreenBufferInfo(handle, &screen_buffer_info)) { | ||
|
@vtjnash can I ask what this line is doing? In particular:
readable
signify?GetNumberOfConsoleInputEvents
to determine the value ofreadable
?