aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-02-24 18:00:36 +0000
committerKaroly Lorentey2004-02-24 18:00:36 +0000
commit1cbfd764118c2fed03fc96fe6b9aad3555270c96 (patch)
tree5febbbda88a69f9db68fc77c76adf7a323ff2669 /src
parent8689463ae016c2af2798782ddf6026f88c4848c9 (diff)
downloademacs-1cbfd764118c2fed03fc96fe6b9aad3555270c96.tar.gz
emacs-1cbfd764118c2fed03fc96fe6b9aad3555270c96.zip
Block more input during read_avail_input.
src/keyboard.c (read_avail_input): Added BLOCK_INPUT. Return -1 when input is blocked or if we could not read input and a display's input hook signalled an error. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-93
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index e3e6896d0da..de91b40d295 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6586,8 +6586,17 @@ read_avail_input (expected)
6586{ 6586{
6587 register int i; 6587 register int i;
6588 int nread = 0; 6588 int nread = 0;
6589 int err;
6589 struct display *d; 6590 struct display *d;
6590 6591
6592 if (interrupt_input_blocked)
6593 {
6594 interrupt_input_pending = 1;
6595 return -1;
6596 }
6597
6598 BLOCK_INPUT;
6599
6591 /* Loop through the available displays, and call their input hooks. */ 6600 /* Loop through the available displays, and call their input hooks. */
6592 d = display_list; 6601 d = display_list;
6593 while (d) 6602 while (d)
@@ -6625,6 +6634,10 @@ read_avail_input (expected)
6625 discard = 1; 6634 discard = 1;
6626 } 6635 }
6627 } 6636 }
6637 else if (nr == -1) /* Not OK to read input now. */
6638 {
6639 err = 1;
6640 }
6628 else if (nr == -2) /* Non-transient error. */ 6641 else if (nr == -2) /* Non-transient error. */
6629 { 6642 {
6630 /* The display device terminated; it should be closed. */ 6643 /* The display device terminated; it should be closed. */
@@ -6653,6 +6666,11 @@ read_avail_input (expected)
6653 d = next; 6666 d = next;
6654 } 6667 }
6655 6668
6669 if (err && !nread)
6670 nread = -1;
6671
6672 UNBLOCK_INPUT;
6673
6656 return nread; 6674 return nread;
6657} 6675}
6658 6676