mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:36:39 +08:00
Correct nfds argument to select()
In readch_timed, we were passing 1 as the number of fds. This is correct if the fd is 0 (stdin) which it typically is; however this will fail if in_ is not stdin. Switch to in_ + 1.
This commit is contained in:
parent
48b42c0255
commit
0dd24c8f74
|
@ -218,7 +218,7 @@ char_event_t input_event_queue_t::readch_timed(bool dequeue_timeouts) {
|
|||
FD_ZERO(&fds);
|
||||
FD_SET(in_, &fds);
|
||||
struct timeval tm = {wait_on_escape_ms / 1000, 1000 * (wait_on_escape_ms % 1000)};
|
||||
if (select(1, &fds, nullptr, nullptr, &tm) > 0) {
|
||||
if (select(in_ + 1, &fds, nullptr, nullptr, &tm) > 0) {
|
||||
result = readch();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user