From e4bce92acb1567a6377995d8d688b95358ec29cf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 19 Sep 2012 14:38:00 -0700 Subject: [PATCH] * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0. Ignore 'expected'. See Eli Zaretskii in (last line). --- src/ChangeLog | 4 ++++ src/w32inevt.c | 10 +++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 42e7f6e87a3..e8827c2de18 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-09-19 Paul Eggert + * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0. + Ignore 'expected'. See Eli Zaretskii in + (last line). + * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul. (XParseGeometry): Now static. Substitute extremal values for values that are out of range. diff --git a/src/w32inevt.c b/src/w32inevt.c index ee07db5335b..d4cc620335c 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -747,7 +747,7 @@ w32_console_read_socket (struct terminal *terminal, int expected, struct input_event *hold_quit) { - int nev, ret = 0, add; + int nev, add; int isdead; if (interrupt_input_blocked) @@ -767,8 +767,7 @@ w32_console_read_socket (struct terminal *terminal, /* If nev == -1, there was some kind of error If nev == 0 then waitp must be zero and no events were available so return. */ - UNBLOCK_INPUT; - return nev; + break; } while (nev > 0) @@ -812,9 +811,6 @@ w32_console_read_socket (struct terminal *terminal, queue_ptr++; nev--; } - - if (ret > 0 || expected == 0) - break; } /* We don't get told about changes in the window size (only the buffer @@ -824,5 +820,5 @@ w32_console_read_socket (struct terminal *terminal, maybe_generate_resize_event (); UNBLOCK_INPUT; - return ret; + return nev; } -- 2.39.2