mirror of
https://github.com/eddyem/tty_term.git
synced 2026-03-20 00:30:59 +03:00
EINTR fixed
This commit is contained in:
5
tty.c
5
tty.c
@@ -49,7 +49,10 @@ int Read_tty(TTY_descr *d){
|
||||
tv.tv_sec = sec; tv.tv_usec = usec;
|
||||
retval = select(d->comfd + 1, &rfds, NULL, NULL, &tv);
|
||||
if(!retval) break;
|
||||
if(retval < 0) return -1;
|
||||
if(retval < 0){
|
||||
if(errno == EINTR) continue;
|
||||
return -1;
|
||||
}
|
||||
if(FD_ISSET(d->comfd, &rfds)){
|
||||
l = read(d->comfd, ptr, length);
|
||||
if(l < 1) return -1; // disconnected
|
||||
|
||||
Reference in New Issue
Block a user