mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Merge pull request #28 from jwilk/error-handling
Fix error handling for select()
This commit is contained in:
commit
daa7d496ba
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ void wait_for_tty_device(void)
|
||||||
|
|
||||||
/* Block until input becomes available or timeout */
|
/* Block until input becomes available or timeout */
|
||||||
status = select(STDIN_FILENO + 1, &rdfs, NULL, NULL, &tv);
|
status = select(STDIN_FILENO + 1, &rdfs, NULL, NULL, &tv);
|
||||||
if (status)
|
if (status > 0)
|
||||||
{
|
{
|
||||||
/* Input from stdin ready */
|
/* Input from stdin ready */
|
||||||
|
|
||||||
|
|
@ -229,7 +229,7 @@ int connect_tty(void)
|
||||||
|
|
||||||
/* Block until input becomes available */
|
/* Block until input becomes available */
|
||||||
status = select(maxfd, &rdfs, NULL, NULL, NULL);
|
status = select(maxfd, &rdfs, NULL, NULL, NULL);
|
||||||
if (status)
|
if (status > 0)
|
||||||
{
|
{
|
||||||
if (FD_ISSET(fd, &rdfs))
|
if (FD_ISSET(fd, &rdfs))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue