mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Rewrite Windows poll()
We can now await signals, files, pipes, and console simultaneously. This change also gives a deeper review and testing to changes made yesterday.
This commit is contained in:
parent
cceddd21b2
commit
fbdf9d028c
15 changed files with 425 additions and 191 deletions
|
@ -1166,9 +1166,9 @@ static void PerformBestEffortIo(void) {
|
|||
DEBUGF("poll() toto=%d [grace=%,ldns]", toto,
|
||||
timespec_tonanos(GetGraceTime()));
|
||||
if (toto) {
|
||||
if (fds[0].revents & (POLLIN | POLLERR))
|
||||
if (fds[0].revents & (POLLIN | POLLHUP | POLLERR))
|
||||
ReadKeyboard();
|
||||
if (fds[1].revents & (POLLOUT | POLLERR))
|
||||
if (fds[1].revents & (POLLOUT | POLLHUP | POLLERR))
|
||||
WriteVideo();
|
||||
}
|
||||
} else if (errno == EINTR) {
|
||||
|
@ -1299,7 +1299,7 @@ static void PickDefaults(void) {
|
|||
*
|
||||
* strcmp(nulltoempty(getenv("TERM")), "xterm-direct") == 0
|
||||
*/
|
||||
if (strcmp(nulltoempty(getenv("TERM")), "xterm-kitty") == 0)
|
||||
if (IsWindows() || !strcmp(nulltoempty(getenv("TERM")), "xterm-kitty"))
|
||||
ttyquantsetup(kTtyQuantTrue, TTYQUANT()->chans, kTtyBlocksUnicode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue