Fix memzoom on Windows
Right now we can't call poll() on file and fifos on Windows. So we work around that by simply blocking on keyboard input. This is OK because on Windows we can't use /proc/*/mem for realtime monitoring, so there's no reason not to block. See #65
This commit is contained in:
@ -318,6 +318,7 @@ static void PreventBufferbloat(void) {
|
||||
|
||||
static bool HasPendingInput(void) {
|
||||
struct pollfd fds[1];
|
||||
if (IsWindows()) return true; /* XXX */
|
||||
fds[0].fd = 0;
|
||||
fds[0].events = POLLIN;
|
||||
fds[0].revents = 0;
|
||||
@ -841,16 +842,19 @@ static void RangesZoom(void) {
|
||||
}
|
||||
|
||||
static void MemZoom(void) {
|
||||
bool ok;
|
||||
ok = false;
|
||||
do {
|
||||
if (action & RESIZED) {
|
||||
GetTtySize();
|
||||
SetupCanvas();
|
||||
action &= ~RESIZED;
|
||||
}
|
||||
if (HasPendingInput()) {
|
||||
if (ok && HasPendingInput()) {
|
||||
ReadKeyboard();
|
||||
continue;
|
||||
if (!IsWindows()) continue; /* XXX */
|
||||
}
|
||||
ok = true;
|
||||
if (pid) {
|
||||
RangesZoom();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user