aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2006-11-08 17:12:03 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2006-11-08 17:12:03 (GMT)
commite06856cc19369a6d1c36efbef77c90d975d298d7 (patch)
treee311cafd5966e2d42d0a74530afcb5c35c09f877
parent7ec657271b18d6298cc5b184eaf5ae81a5beb268 (diff)
downloadpowwow-e06856cc19369a6d1c36efbef77c90d975d298d7.zip
powwow-e06856cc19369a6d1c36efbef77c90d975d298d7.tar.gz
powwow-e06856cc19369a6d1c36efbef77c90d975d298d7.tar.bz2
This fixed #bind and #rebind problems, patch from kalev lemberv1.2.11
-rw-r--r--cmd2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd2.c b/cmd2.c
index 8e6a110..1b9b1be 100644
--- a/cmd2.c
+++ b/cmd2.c
@@ -1054,7 +1054,7 @@ static int get_one_char __P1 (int,timeout)
timeoutbuf.tv_usec = timeout * uSEC_PER_mSEC;
err = select(tty_read_fd+1, &fds, NULL, NULL,
timeout ? &timeoutbuf : NULL);
- if (err == 0 || (err == -1 && errno == EINTR))
+ if (err == -1 && errno == EINTR)
return -1;
if (err == -1) {
errmsg("select");
@@ -1062,6 +1062,9 @@ static int get_one_char __P1 (int,timeout)
}
while ((err = tty_read(&c, 1)) < 0 && errno == EINTR)
;
+ if (err != 1 && errno == EAGAIN) {
+ return -1;
+ }
if (err != 1) {
errmsg("read from tty");
return -1;