diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2006-11-08 17:12:03 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2006-11-08 17:12:03 (GMT) |
commit | e06856cc19369a6d1c36efbef77c90d975d298d7 (patch) | |
tree | e311cafd5966e2d42d0a74530afcb5c35c09f877 /cmd2.c | |
parent | 7ec657271b18d6298cc5b184eaf5ae81a5beb268 (diff) | |
download | powwow-e06856cc19369a6d1c36efbef77c90d975d298d7.zip powwow-e06856cc19369a6d1c36efbef77c90d975d298d7.tar.gz powwow-e06856cc19369a6d1c36efbef77c90d975d298d7.tar.bz2 |
This fixed #bind and #rebind problems, patch from kalev lemberv1.2.11
Diffstat (limited to 'cmd2.c')
-rw-r--r-- | cmd2.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |