monero-wallet-cli: hang on exit in readline code (#2117)
readline_buffer: move a local to local scope Also limit the select fd limit to what we use Signed-off-by: Jethro Grassie <jtg@xtrabass.com>
This commit is contained in:
parent
a73a42a6b0
commit
76043b17fd
|
@ -126,19 +126,18 @@ int rdln::readline_buffer::sync()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static fd_set fds;
|
|
||||||
|
|
||||||
static int process_input()
|
static int process_input()
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
|
fd_set fds;
|
||||||
|
|
||||||
t.tv_sec = 0;
|
t.tv_sec = 0;
|
||||||
t.tv_usec = 1000;
|
t.tv_usec = 1000;
|
||||||
|
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
FD_SET(STDIN_FILENO, &fds);
|
FD_SET(STDIN_FILENO, &fds);
|
||||||
count = select(FD_SETSIZE, &fds, NULL, NULL, &t);
|
count = select(STDIN_FILENO + 1, &fds, NULL, NULL, &t);
|
||||||
if (count < 1)
|
if (count < 1)
|
||||||
{
|
{
|
||||||
return count;
|
return count;
|
||||||
|
|
Loading…
Reference in New Issue